mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-03 20:54:42 +02:00
Fix issue #250
This commit is contained in:
@@ -946,11 +946,14 @@ void TFT_eSprite::fillRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t
|
|||||||
{
|
{
|
||||||
if (!_created ) return;
|
if (!_created ) return;
|
||||||
|
|
||||||
|
if ((x >= _iwidth) || (y >= _iheight)) return;
|
||||||
|
|
||||||
if (x < 0) { w += x; x = 0; }
|
if (x < 0) { w += x; x = 0; }
|
||||||
|
if (y < 0) { h += y; y = 0; }
|
||||||
|
|
||||||
if ((x < 0) || (y < 0) || (x >= _iwidth) || (y >= _iheight)) return;
|
|
||||||
if ((x + w) > _iwidth) w = _iwidth - x;
|
if ((x + w) > _iwidth) w = _iwidth - x;
|
||||||
if ((y + h) > _iheight) h = _iheight - y;
|
if ((y + h) > _iheight) h = _iheight - y;
|
||||||
|
|
||||||
if ((w < 1) || (h < 1)) return;
|
if ((w < 1) || (h < 1)) return;
|
||||||
|
|
||||||
int32_t yp = _iwidth * y + x;
|
int32_t yp = _iwidth * y + x;
|
||||||
|
Reference in New Issue
Block a user