summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/popup.cpp40
-rw-r--r--src/gui/widgets/popup.h2
2 files changed, 25 insertions, 17 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 7383ac94b..2e9b3b99b 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -108,33 +108,39 @@ void Popup::draw(Graphics *graphics)
if (mSkin)
{
- if (isBatchDrawRenders(openGLMode))
+ if (mRedraw)
{
- if (mRedraw)
- {
- mRedraw = false;
- mVertexes->clear();
- graphics->calcWindow(mVertexes,
- 0, 0,
- mDimension.width, mDimension.height,
- mSkin->getBorder());
- }
- // need cache or remove calc call.
- graphics->finalize(mVertexes);
- graphics->drawTileCollection(mVertexes);
- }
- else
- {
- graphics->drawImageRect(0, 0,
+ mRedraw = false;
+ mVertexes->clear();
+ graphics->calcWindow(mVertexes,
+ 0, 0,
mDimension.width, mDimension.height,
mSkin->getBorder());
}
+ // need cache or remove calc call.
+ graphics->finalize(mVertexes);
+ graphics->drawTileCollection(mVertexes);
}
drawChildren(graphics);
BLOCK_END("Popup::draw")
}
+void Popup::safeDraw(Graphics *graphics)
+{
+ BLOCK_START("Popup::safeDraw")
+
+ if (mSkin)
+ {
+ graphics->drawImageRect(0, 0,
+ mDimension.width, mDimension.height,
+ mSkin->getBorder());
+ }
+
+ drawChildren(graphics);
+ BLOCK_END("Popup::safeDraw")
+}
+
Rect Popup::getChildrenArea()
{
const int pad2 = mPadding * 2;
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index f39a92ec0..d1dbb4829 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -78,6 +78,8 @@ class Popup notfinal : public Container,
*/
void draw(Graphics *graphics) override;
+ void safeDraw(Graphics *graphics) override;
+
/**
* Sets the size of this popup.
*/