summaryrefslogtreecommitdiff
path: root/components/gui/src/dc_hw.c
diff options
context:
space:
mode:
authoryangfasheng <[email protected]>2017-12-12 19:46:38 +0800
committeryangfasheng <[email protected]>2017-12-12 19:46:38 +0800
commit2d98c0e7be8e0803de4b4e8e9ba03635bcef91c8 (patch)
tree2369b56b2cb936de281b8e8b335da94828298af3 /components/gui/src/dc_hw.c
parent44e17aa2772a48697604ba1122da4a0bb9015414 (diff)
gui 引擎代码更新;
Diffstat (limited to 'components/gui/src/dc_hw.c')
-rw-r--r--components/gui/src/dc_hw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/gui/src/dc_hw.c b/components/gui/src/dc_hw.c
index dfed6f8e9f..2af8ae94cf 100644
--- a/components/gui/src/dc_hw.c
+++ b/components/gui/src/dc_hw.c
@@ -216,22 +216,32 @@ static void rtgui_dc_hw_fill_rect(struct rtgui_dc *self, struct rtgui_rect *rect
return;
if (x1 < dc->owner->extent.x1)
x1 = dc->owner->extent.x1;
+ if (x1 < 0)
+ x1 = 0;
+
x2 = rect->x2 + dc->owner->extent.x1;
if (x2 < dc->owner->extent.x1)
return;
if (x2 > dc->owner->extent.x2)
x2 = dc->owner->extent.x2;
+ if (x2 > dc->hw_driver->width)
+ x2 = dc->hw_driver->width;
y1 = rect->y1 + dc->owner->extent.y1;
if (y1 > dc->owner->extent.y2)
return;
if (y1 < dc->owner->extent.y1)
y1 = dc->owner->extent.y1;
+ if (y1 < 0)
+ y1 = 0;
+
y2 = rect->y2 + dc->owner->extent.y1;
if (y2 < dc->owner->extent.y1)
return;
if (y2 > dc->owner->extent.y2)
y2 = dc->owner->extent.y2;
+ if (y2 > dc->hw_driver->height)
+ y2 = dc->hw_driver->height;
/* fill rect */
for (; y1 < y2; y1++)