aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-01-05 05:05:59 +0100
committerJoel Bodenmann <joel@unormal.org>2014-01-05 05:05:59 +0100
commitbd3109851b2f239677a8516eec6729124d11b344 (patch)
tree3e121fdcf435130c83a8131bd05ac46d44afeee1 /src/gwin/gwin.c
parenta6b81192eb2ce4df34b04253c28b50e797aaccc9 (diff)
downloaduGFX-bd3109851b2f239677a8516eec6729124d11b344.tar.gz
uGFX-bd3109851b2f239677a8516eec6729124d11b344.tar.bz2
uGFX-bd3109851b2f239677a8516eec6729124d11b344.zip
now using absolute coordinates inside the window
Diffstat (limited to 'src/gwin/gwin.c')
-rw-r--r--src/gwin/gwin.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c
index 27f893a8..79a52a62 100644
--- a/src/gwin/gwin.c
+++ b/src/gwin/gwin.c
@@ -274,22 +274,6 @@ bool_t gwinGetEnabled(GHandle gh) {
#endif
}
-void gwinGetAbsoluteCoordinates(GHandle gh, coord_t *x, coord_t *y) {
- #if GWIN_NEED_HIERARCHY
- GHandle tmp;
-
- // sum up all relative coordinates up to the root parent
- for (*x = 0, *y = 0, tmp = gh; tmp; tmp = tmp->parent) {
- *x += tmp->x;
- *y += tmp->y;
- }
-
- #else
- *x = gh->x;
- *y = gh->y;
- #endif
-}
-
void gwinMove(GHandle gh, coord_t x, coord_t y) {
_gwm_redim(gh, x, y, gh->width, gh->height);
}
@@ -335,14 +319,14 @@ void gwinRedraw(GHandle gh) {
parent->child = child;
}
- #if GDISP_NEED_CLIP
- gdispGSetClip(child->display, child->x, child->y, child->width, child->height);
- #endif
- gdispGFillArea(child->display, child->x, child->y, child->width, child->height, child->bgcolor);
- #if GDISP_NEED_CLIP
- gdispGUnsetClip(child->display);
- #endif
+ // clear the area of the current child position as it will be moved
+ gwinClear(child);
+
+ // window coordinates until now are relative, make them absolute now.
+ child->x += parent->x;
+ child->y += parent->y;
+ // redraw the window
gwinClear(parent);
gwinRedraw(parent);
}