24 Rectangle() : x_(0), y_(0), width_(0), height_(0) {}
27 : x_(0), y_(0), width_(max(0, width)), height_(max(0,
height))
32 : x_(x), y_(y), width_(max(0, width)), height_(max(0,
height))
42 width_ =
other.width_;
43 height_ =
other.height_;
50 && (height_ ==
other.height_);
54 bool IsEmpty()
const {
return (width_ <= 0) || (height_ <= 0); }
69 return {x_, y_, width, height_};
73 return {x_, y_, width_,
height};
77 return {x_, y_, width,
height};
260 int16_t x_, y_, width_, height_;
262 int16_t min(int16_t a, int16_t b) {
return (a < b) ? a : b; }
Definition leddriver.h:33
Definition graphics_common.h:22
Rectangle WithTop(int16_t top) const
Definition graphics_common.h:127
Rectangle WithCenterX(int16_t centerX) const
Definition graphics_common.h:161
Rectangle WithX(int16_t x) const
Definition graphics_common.h:65
int16_t GetY() const
Definition graphics_common.h:57
int16_t GetRight() const
Definition graphics_common.h:60
bool operator!=(const Rectangle &other) const
Definition graphics_common.h:52
Rectangle RemoveFromRight(int16_t pxToRemove)
Definition graphics_common.h:187
Rectangle WithCenterY(int16_t centerY) const
Definition graphics_common.h:166
Rectangle WithRight(int16_t right) const
Definition graphics_common.h:121
Rectangle RemoveFromBottom(int16_t pxToRemove)
Definition graphics_common.h:202
int16_t GetWidth() const
Definition graphics_common.h:58
Rectangle WithWidth(int16_t width) const
Definition graphics_common.h:67
Rectangle RemoveFromLeft(int16_t pxToRemove)
Definition graphics_common.h:179
Rectangle AlignedWithin(const Rectangle &other, Alignment alignment) const
Definition graphics_common.h:209
Rectangle WithTrimmedLeft(int16_t pxToTrim) const
Definition graphics_common.h:139
Rectangle(int16_t width, int16_t height)
Definition graphics_common.h:26
Rectangle WithCenter(int16_t centerX, int16_t centerY) const
Definition graphics_common.h:171
Rectangle Reduced(int16_t sizeToReduce) const
Definition graphics_common.h:95
Rectangle WithWidthKeepingCenter(int16_t width) const
Definition graphics_common.h:79
Rectangle WithSizeKeepingCenter(int16_t width, int16_t height) const
Definition graphics_common.h:89
int16_t GetBottom() const
Definition graphics_common.h:61
bool operator==(const Rectangle &other) const
Definition graphics_common.h:47
Rectangle RemoveFromTop(int16_t pxToRemove)
Definition graphics_common.h:194
Rectangle(const Rectangle &other)
Definition graphics_common.h:36
int16_t GetHeight() const
Definition graphics_common.h:59
int16_t GetCenterY() const
Definition graphics_common.h:63
bool IsEmpty() const
Definition graphics_common.h:54
Rectangle WithHeightKeepingCenter(int16_t height) const
Definition graphics_common.h:84
Rectangle Reduced(int16_t xToReduce, int16_t yToReduce) const
Definition graphics_common.h:102
int16_t GetCenterX() const
Definition graphics_common.h:62
Rectangle(int16_t x, int16_t y, int16_t width, int16_t height)
Definition graphics_common.h:31
Rectangle WithSize(int16_t width, int16_t height) const
Definition graphics_common.h:75
int16_t GetX() const
Definition graphics_common.h:56
Rectangle & operator=(const Rectangle &other)
Definition graphics_common.h:38
Rectangle WithHeight(int16_t height) const
Definition graphics_common.h:71
Rectangle WithBottom(int16_t bottom) const
Definition graphics_common.h:133
Rectangle WithTrimmedTop(int16_t pxToTrim) const
Definition graphics_common.h:150
Rectangle WithTrimmedRight(int16_t pxToTrim) const
Definition graphics_common.h:145
Rectangle WithY(int16_t y) const
Definition graphics_common.h:66
Rectangle WithTrimmedBottom(int16_t pxToTrim) const
Definition graphics_common.h:156
Rectangle()
Definition graphics_common.h:24
Rectangle Translated(int16_t x, int16_t y) const
Definition graphics_common.h:110
Rectangle WithLeft(int16_t left) const
Definition graphics_common.h:115
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Alignment
Definition graphics_common.h:9