diff options
| author | bernard.xiong <[email protected]> | 2011-09-21 10:18:09 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2011-09-21 10:18:09 +0000 |
| commit | c2badd89839f7ac2b5244210493586d1e0ada81d (patch) | |
| tree | a659477f7d2196e53c6032676c5c1eae86235e04 /components | |
| parent | a397fef958ce2ef31ca0a2021b1e6044eb1220a4 (diff) | |
fixed drawing point issue when this point is out of buffer dc.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1719 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
| -rw-r--r-- | components/rtgui/common/dc_buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/rtgui/common/dc_buffer.c b/components/rtgui/common/dc_buffer.c index 40da901bd0..53cc07d959 100644 --- a/components/rtgui/common/dc_buffer.c +++ b/components/rtgui/common/dc_buffer.c @@ -134,6 +134,9 @@ static void rtgui_dc_buffer_draw_point(struct rtgui_dc* self, int x, int y) dc = (struct rtgui_dc_buffer*)self; + /* does not draw point out of dc */ + if ((x > dc->width) || (y > dc->height)) return ; + /* note: there is no parameter check in this function */ ptr = (rtgui_color_t*)(dc->pixel + y * dc->pitch + x * sizeof(rtgui_color_t)); |
