Fix check for empty clipping array (#4421)

This commit is contained in:
NP v/d Spek authored and Jesse Hills committed 2023-02-13 11:54:26 +13:00
1 parent 8cf26d6f3c
commit 310355a00b
2 files changed
+28 -40

No files matched your search

@@ -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);
}
}