Explorar o código

append patch:about rtgui_dc_client_blit_line.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1650 bbd45198-f89e-11dd-88c7-29a3b14d5316
iamyhw@gmail.com %!s(int64=14) %!d(string=hai) anos
pai
achega
6f8bf54fb0
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      components/rtgui/common/dc_client.c

+ 7 - 2
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 ++)
 	{