mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +00:00
Fix check for empty clipping array (#4421)
This commit is contained in:
@@ -16,11 +16,11 @@ const Color COLOR_OFF(0, 0, 0, 0);
|
||||
const Color COLOR_ON(255, 255, 255, 255);
|
||||
|
||||
void Rect::expand(int16_t horizontal, int16_t vertical) {
|
||||
if ((*this).is_set() && ((*this).w >= (-2 * horizontal)) && ((*this).h >= (-2 * vertical))) {
|
||||
(*this).x = (*this).x - horizontal;
|
||||
(*this).y = (*this).y - vertical;
|
||||
(*this).w = (*this).w + (2 * horizontal);
|
||||
(*this).h = (*this).h + (2 * vertical);
|
||||
if (this->is_set() && (this->w >= (-2 * horizontal)) && (this->h >= (-2 * vertical))) {
|
||||
this->x = this->x - horizontal;
|
||||
this->y = this->y - vertical;
|
||||
this->w = this->w + (2 * horizontal);
|
||||
this->h = this->h + (2 * vertical);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user