summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-06-27 03:03:44 +0000
committer[email protected] <[email protected]>2012-06-27 03:03:44 +0000
commitb440fc981e5d8297e5af83b7cebf70d757dc04fb (patch)
treea5d95b215351ace2212438a093d838926162bb99
parentcfb550b8d18d9ed0e8881f40a21bb2d6ed9c3563 (diff)
beautify the focused rectangle.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2191 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--components/rtgui/common/dc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/components/rtgui/common/dc.c b/components/rtgui/common/dc.c
index 9979668c66..fa8b85225a 100644
--- a/components/rtgui/common/dc.c
+++ b/components/rtgui/common/dc.c
@@ -248,18 +248,22 @@ void rtgui_dc_draw_shaded_rect(struct rtgui_dc* dc, rtgui_rect_t* rect,
void rtgui_dc_draw_focus_rect(struct rtgui_dc* dc, rtgui_rect_t* rect)
{
- int i;
+ int x,y;
- for (i = rect->x1; i < rect->x2; i += 2)
+ for (x=rect->x1; x<rect->x2-1; x++)
{
- rtgui_dc_draw_point(dc, i, rect->y1);
- rtgui_dc_draw_point(dc, i, rect->y2 - 1);
+ if ((x+rect->y1)&0x01)
+ rtgui_dc_draw_point(dc, x, rect->y1);
+ if ((x+rect->y2-1)&0x01)
+ rtgui_dc_draw_point(dc, x, rect->y2-1);
}
- for (i = rect->y1; i < rect->y2; i += 2)
+ for (y=rect->y1; y<rect->y2; y++)
{
- rtgui_dc_draw_point(dc, rect->x1, i);
- rtgui_dc_draw_point(dc, rect->x2 - 1, i);
+ if ((rect->x1+y)&0x01)
+ rtgui_dc_draw_point(dc, rect->x1, y);
+ if ((rect->x2-1+y)&0x01)
+ rtgui_dc_draw_point(dc, rect->x2-1, y);
}
}