提交 f6db5d1c 编写于 作者: I iamyhw@gmail.com

Fixd dc_buffer_fill_rect color,The foreground and background exchanged.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1646 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 446dafeb
......@@ -195,6 +195,7 @@ static void rtgui_dc_buffer_draw_hline(struct rtgui_dc* self, int x1, int x2, in
static void rtgui_dc_buffer_fill_rect (struct rtgui_dc* self, struct rtgui_rect* rect)
{
rtgui_color_t foreground;
rtgui_rect_t r;
struct rtgui_dc_buffer* dc;
......@@ -204,6 +205,12 @@ static void rtgui_dc_buffer_fill_rect (struct rtgui_dc* self, struct rtgui_rect*
if (r.x2 > dc->width) r.x2 = dc->width;
if (r.y1 > dc->height) r.y1 = dc->height;
if (r.y2 > dc->height) r.y2 = dc->height;
/* save foreground color */
foreground = RTGUI_DC_FC(self);
/* set background color as foreground color */
RTGUI_DC_FC(self) = RTGUI_DC_BC(self);
/* fill first line */
rtgui_dc_buffer_draw_hline(&(dc->parent), r.x1, r.x2, r.y1);
......@@ -219,6 +226,9 @@ static void rtgui_dc_buffer_fill_rect (struct rtgui_dc* self, struct rtgui_rect*
(r.x2 - r.x1) * sizeof(rtgui_color_t));
}
}
/* restore foreground color */
RTGUI_DC_FC(self) = foreground;
}
/* blit a dc to a hardware dc */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册