aboutsummaryrefslogtreecommitdiff
path: root/dw/stackingcontextmgr.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-12-27 00:09:10 +0100
committerSebastian Geerken <devnull@localhost>2014-12-27 00:09:10 +0100
commit612bbc9abfe07c041dcb647e748e12c3f4d06c3c (patch)
tree3127aee6377a52d965352c23bbfa6f3281220aaa /dw/stackingcontextmgr.cc
parente705d0fa68041490d485cdc5b390ccf80e771722 (diff)
Fixed usage of Widget::interects.
Diffstat (limited to 'dw/stackingcontextmgr.cc')
-rw-r--r--dw/stackingcontextmgr.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/dw/stackingcontextmgr.cc b/dw/stackingcontextmgr.cc
index c9039e73..5dd49309 100644
--- a/dw/stackingcontextmgr.cc
+++ b/dw/stackingcontextmgr.cc
@@ -173,9 +173,19 @@ void StackingContextMgr::draw (View *view, Rectangle *area,
Widget *child = childSCWidgets->get (*index);
DBG_OBJ_MSGF ("draw", 2, "widget %p has zIndex = %d",
child, child->getStyle()->zIndex);
- Rectangle childArea;
+ Rectangle parentArea, childArea;
+
+ // This is a hack: since "area" is given in widget coordinates,
+ // but the calling widget is not necessary the parent, as
+ // Widget::interects assumes, "area" has to be corrected.
+ parentArea = *area;
+ area->x += widget->getAllocation()->x
+ - child->getParent()->getAllocation()->x;
+ area->y += widget->getAllocation()->y
+ - child->getParent()->getAllocation()->y;
+
if (child->getStyle()->zIndex == zIndices[*zIndexIndex] &&
- child->intersects (area, &childArea))
+ child->intersects (&parentArea, &childArea))
child->drawTotal (view, &childArea, iteratorStack,
interruptedWidget);