summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-11-28 08:01:15 +0000
committer[email protected] <[email protected]>2011-11-28 08:01:15 +0000
commitb38a97572cf3df79cbc5baa3b45c8341138031de (patch)
treee27292426e5b5e3369ee381b2966d65e7ba9a3b9 /components
parent0803e79b539ffafcba7049e15dd064ab1e389c31 (diff)
rtgui/widgets/notebook: get rect only when needed
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1815 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
-rw-r--r--components/rtgui/widgets/notebook.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/components/rtgui/widgets/notebook.c b/components/rtgui/widgets/notebook.c
index 5fea83d264..03f6dfc9cc 100644
--- a/components/rtgui/widgets/notebook.c
+++ b/components/rtgui/widgets/notebook.c
@@ -69,15 +69,14 @@ static void _rtgui_notebook_draw_bar(struct rtgui_notebook *notebook,
static void _rtgui_notebook_ondraw(rtgui_notebook_t *notebook)
{
struct rtgui_dc* dc;
- rtgui_rect_t rect;
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(notebook));
if (dc == RT_NULL) return;
- rtgui_widget_get_rect(RTGUI_WIDGET(notebook), &rect);
-
if (notebook->count == 0)
{
+ rtgui_rect_t rect;
+ rtgui_widget_get_rect(RTGUI_WIDGET(notebook), &rect);
rtgui_dc_fill_rect(dc, &rect);
}
else
@@ -124,7 +123,7 @@ static void _rtgui_notebook_onmouse(rtgui_notebook_t *notebook, struct rtgui_eve
/* handle on page */
if (notebook->childs[notebook->current].widget->event_handler != RT_NULL)
- notebook->childs[notebook->current].widget->event_handler(notebook->childs[notebook->current].widget,
+ notebook->childs[notebook->current].widget->event_handler(notebook->childs[notebook->current].widget,
&(emouse->parent));
}