many updates..
new sensors.. display.. led.. drawing.. stuff..
This commit is contained in:
39
ext/lcd/ui/UIStructs.h
Normal file
39
ext/lcd/ui/UIStructs.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef UI_STRUCTS_H
|
||||
#define UI_STRUCTS_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct UIPoint {
|
||||
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
|
||||
UIPoint() : x(0), y(0) {;}
|
||||
|
||||
UIPoint(uint16_t x, uint16_t y) : x(x), y(y) {;}
|
||||
|
||||
};
|
||||
|
||||
struct UIRect {
|
||||
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
|
||||
uint16_t w;
|
||||
uint16_t h;
|
||||
|
||||
UIRect() : x(0), y(0), w(0), h(0) {;}
|
||||
|
||||
UIRect(const uint16_t x, const uint16_t y, const uint16_t w, const uint16_t h) : x(x), y(y), w(w), h(h) {;}
|
||||
|
||||
bool contains(const uint16_t x, const uint16_t y) const {
|
||||
return
|
||||
(this->x <= x) &&
|
||||
(this->y <= y) &&
|
||||
(x <= this->x+this->w) &&
|
||||
(y <= this->y+this->h);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // UI_STRUCTS_H
|
||||
Reference in New Issue
Block a user