diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-25 17:21:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-25 17:21:15 +0300 |
commit | e3672baa9a0d62ffcc1cb693cbb94644755b6d58 (patch) | |
tree | 797d479ab57bdb1eba5760f96c755f85372161d3 /src/gui/widgets | |
parent | 68d07e98a4d8721b9e93a87ecd573fbc336b565b (diff) | |
download | manaplus-e3672baa9a0d62ffcc1cb693cbb94644755b6d58.tar.gz manaplus-e3672baa9a0d62ffcc1cb693cbb94644755b6d58.tar.bz2 manaplus-e3672baa9a0d62ffcc1cb693cbb94644755b6d58.tar.xz manaplus-e3672baa9a0d62ffcc1cb693cbb94644755b6d58.zip |
Add safeDraw method into popup.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/popup.cpp | 40 | ||||
-rw-r--r-- | src/gui/widgets/popup.h | 2 |
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. */ |