From 6f8bf54fb0523fab20431b55fd1da7e7ddb1323a Mon Sep 17 00:00:00 2001 From: "iamyhw@gmail.com" Date: Mon, 25 Jul 2011 06:37:00 +0000 Subject: [PATCH] append patch:about rtgui_dc_client_blit_line. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1650 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/rtgui/common/dc_client.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/rtgui/common/dc_client.c b/components/rtgui/common/dc_client.c index 2b43d189e..244de209a 100644 --- a/components/rtgui/common/dc_client.c +++ b/components/rtgui/common/dc_client.c @@ -443,7 +443,7 @@ static void rtgui_dc_client_blit_line (struct rtgui_dc* self, int x1, int x2, in if (rtgui_region_is_flat(&(owner->clip)) == RT_EOK) { rtgui_rect_t* prect; - + int offset = 0; prect = &(owner->clip.extents); /* calculate vline intersect */ @@ -453,8 +453,13 @@ static void rtgui_dc_client_blit_line (struct rtgui_dc* self, int x1, int x2, in if (prect->x1 > x1) x1 = prect->x1; if (prect->x2 < x2) x2 = prect->x2; + /* patch note: + * We need to adjust the offset when update widget clip! + * Of course at ordinary times for 0. General */ + offset = owner->clip.extents.x1 - owner->extent.x1; + offset = offset * hw_driver->bits_per_pixel/8; /* draw hline */ - hw_driver->ops->draw_raw_hline(line_data, x1, x2, y); + hw_driver->ops->draw_raw_hline(line_data+offset, x1, x2, y); } else for (index = 0; index < rtgui_region_num_rects(&(owner->clip)); index ++) {