summaryrefslogtreecommitdiff
path: root/src/gui/widgets/basiccontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/basiccontainer.cpp')
-rw-r--r--src/gui/widgets/basiccontainer.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/gui/widgets/basiccontainer.cpp b/src/gui/widgets/basiccontainer.cpp
index 6d09cb64b..cd1dac0a2 100644
--- a/src/gui/widgets/basiccontainer.cpp
+++ b/src/gui/widgets/basiccontainer.cpp
@@ -324,10 +324,47 @@ void BasicContainer::drawChildren(Graphics* graphics)
graphics->pushClipArea(widget->mDimension);
BLOCK_START("BasicContainer::drawChildren 2")
- if (isBatchDrawRenders(openGLMode))
- widget->draw(graphics);
- else
- widget->safeDraw(graphics);
+ widget->draw(graphics);
+ BLOCK_END("BasicContainer::drawChildren 2")
+ graphics->popClipArea();
+ }
+ }
+
+ graphics->popClipArea();
+ BLOCK_END("BasicContainer::drawChildren")
+}
+
+void BasicContainer::safeDrawChildren(Graphics* graphics)
+{
+ BLOCK_START("BasicContainer::drawChildren")
+ graphics->pushClipArea(getChildrenArea());
+
+ FOR_EACH (WidgetListConstIterator, iter, mWidgets)
+ {
+ Widget *const widget = *iter;
+ if (widget->isVisibleLocal())
+ {
+ // If the widget has a frame,
+ // draw it before drawing the widget
+ if (widget->mFrameSize > 0)
+ {
+ Rect rec = widget->mDimension;
+ const int frame = widget->mFrameSize;
+ const int frame2 = frame * 2;
+ rec.x -= frame;
+ rec.y -= frame;
+ rec.width += frame2;
+ rec.height += frame2;
+ graphics->pushClipArea(rec);
+ BLOCK_START("BasicContainer::drawChildren 1")
+ widget->drawFrame(graphics);
+ BLOCK_END("BasicContainer::drawChildren 1")
+ graphics->popClipArea();
+ }
+
+ graphics->pushClipArea(widget->mDimension);
+ BLOCK_START("BasicContainer::drawChildren 2")
+ widget->safeDraw(graphics);
BLOCK_END("BasicContainer::drawChildren 2")
graphics->popClipArea();
}