summaryrefslogtreecommitdiff
path: root/components/rtgui
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-07-21 01:40:56 +0000
committer[email protected] <[email protected]>2011-07-21 01:40:56 +0000
commitf6db5d1c744ee7d490d817d4a039577d110c5572 (patch)
tree596c37b900f26a3ee144a84bd82ec2ed4421429b /components/rtgui
parent446dafebadcf059688fdc62edd4dfbc48f0afa5b (diff)
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
Diffstat (limited to 'components/rtgui')
-rw-r--r--components/rtgui/common/dc_buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/rtgui/common/dc_buffer.c b/components/rtgui/common/dc_buffer.c
index 7677fa9dd5..40da901bd0 100644
--- a/components/rtgui/common/dc_buffer.c
+++ b/components/rtgui/common/dc_buffer.c
@@ -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 */