aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
Diffstat (limited to 'dw')
-rw-r--r--dw/ooffloatsmgr.cc7
-rw-r--r--dw/oofpositionedmgr.cc3
-rw-r--r--dw/stackingcontextmgr.cc2
-rw-r--r--dw/stackingcontextmgr.hh8
-rw-r--r--dw/table.cc3
-rw-r--r--dw/textblock.cc5
6 files changed, 20 insertions, 8 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc
index 7850b18f..eecd4faa 100644
--- a/dw/ooffloatsmgr.cc
+++ b/dw/ooffloatsmgr.cc
@@ -1284,10 +1284,11 @@ void OOFFloatsMgr::drawFloats (SortedFloatsVector *list, View *view,
// first float fitting into the area, and iterate until one is
// found below the area.
for (int i = 0; i < list->size(); i++) {
- Float *vloat = list->get(i);
+ Widget *childWidget = list->get(i)->getWidget ();
Rectangle childArea;
- if (vloat->getWidget()->intersects (area, &childArea))
- vloat->getWidget()->draw (view, &childArea);
+ if (!StackingContextMgr::handledByStackingContextMgr (childWidget) &&
+ childWidget->intersects (area, &childArea))
+ childWidget->draw (view, &childArea);
}
}
diff --git a/dw/oofpositionedmgr.cc b/dw/oofpositionedmgr.cc
index 3efb5002..4799ec8c 100644
--- a/dw/oofpositionedmgr.cc
+++ b/dw/oofpositionedmgr.cc
@@ -176,7 +176,8 @@ void OOFPositionedMgr::draw (View *view, Rectangle *area)
for (int i = 0; i < children->size(); i++) {
Widget *childWidget = children->get(i)->widget;
Rectangle childArea;
- if (childWidget->intersects (area, &childArea))
+ if (!StackingContextMgr::handledByStackingContextMgr (childWidget) &&
+ childWidget->intersects (area, &childArea))
childWidget->draw (view, &childArea);
}
diff --git a/dw/stackingcontextmgr.cc b/dw/stackingcontextmgr.cc
index 333f0707..b3573a3f 100644
--- a/dw/stackingcontextmgr.cc
+++ b/dw/stackingcontextmgr.cc
@@ -67,7 +67,7 @@ void StackingContextMgr::drawBottom (View *view, Rectangle *area)
void StackingContextMgr::drawTop (View *view, Rectangle *area)
{
- DBG_OBJ_ENTER ("draw", 0, "drawBottom", "%d, %d, %d * %d",
+ DBG_OBJ_ENTER ("draw", 0, "drawTop", "%d, %d, %d * %d",
area->x, area->y, area->width, area->height);
draw (view, area, 0, INT_MAX);
DBG_OBJ_LEAVE ();
diff --git a/dw/stackingcontextmgr.hh b/dw/stackingcontextmgr.hh
index 36acfb11..cbb59231 100644
--- a/dw/stackingcontextmgr.hh
+++ b/dw/stackingcontextmgr.hh
@@ -35,6 +35,14 @@ public:
widget->getStyle()->zIndex != style::Z_INDEX_AUTO;
}
+ inline static bool handledByStackingContextMgr (Widget *widget) {
+ // Each widget establishing a stacking context is child of another
+ // stacking context, so drawn by StackingContextMgr::drawTop or
+ // StackingContextMgr::drawBottom etc.
+ return widget->getParent () != NULL
+ && isEstablishingStackingContext (widget);
+ }
+
void addChildSCWidget (Widget *widget);
void drawBottom (View *view, Rectangle *area);
diff --git a/dw/table.cc b/dw/table.cc
index d443327b..4259111a 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -382,7 +382,8 @@ void Table::draw (core::View *view, core::Rectangle *area)
if (childDefined (i)) {
Widget *child = children->get(i)->cell.widget;
core::Rectangle childArea;
- if (child->intersects (area, &childArea))
+ if (!core::StackingContextMgr::handledByStackingContextMgr (child) &&
+ child->intersects (area, &childArea))
child->draw (view, &childArea);
}
}
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 9bff14d7..df38a8e7 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1447,8 +1447,9 @@ void Textblock::drawLine (Line *line, core::View *view, core::Rectangle *area)
if (word->content.type == core::Content::WIDGET_IN_FLOW) {
core::Widget *child = word->content.widget;
core::Rectangle childArea;
-
- if (child->intersects (area, &childArea))
+ if (!core::StackingContextMgr::handledByStackingContextMgr
+ (child) &&
+ child->intersects (area, &childArea))
child->draw (view, &childArea);
} else {
int wordIndex2 = wordIndex;