Fix for drawMask() when x < 0

This commit is contained in:
Bertrand Songis
2019-10-22 17:35:15 +02:00
parent 72f8420f9c
commit 5590c60174
+6
View File
@@ -326,6 +326,12 @@ void BitmapBuffer::drawMask(coord_t x, coord_t y, const BitmapBuffer * mask, Lcd
width = xmax - x; width = xmax - x;
} }
if (x < 0) {
width += x;
offset -= x;
x = 0;
}
if (y >= ymax || x >= xmax || width <= 0 || x + width < xmin || y + height < ymin) { if (y >= ymax || x >= xmax || width <= 0 || x + width < xmin || y + height < ymin) {
return; return;
} }