Prevent negative values in DMAFillRect (#5308)

This commit is contained in:
3djc
2017-10-29 16:28:51 +01:00
committed by Andre Bernet
parent b4cf7315a5
commit 9a95b47c96
+1 -1
View File
@@ -216,7 +216,7 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
if (!data || h==0 || w==0) return;
if (h<0) { y+=h; h=-h; }
if (w<0) { x+=w; w=-w; }
DMAFillRect(data, width, height, x, y, w, h, lcdColorTable[COLOR_IDX(flags)]);
DMAFillRect(data, width, height, (x>0)?x:0, (y>0)?y:0, w, h, lcdColorTable[COLOR_IDX(flags)]);
}
void drawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att);