diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-25 18:12:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-25 18:12:50 +0300 |
commit | 004f4e8ad24087051cafd5b79e9abfafa577f24d (patch) | |
tree | 3fc51552e443ae298858bae520fd2d5c38532c85 /src/gui/widgets/scrollarea.cpp | |
parent | 9569e469a481076bdbc330377bf8445eb32fbaa6 (diff) | |
download | manaplus-004f4e8ad24087051cafd5b79e9abfafa577f24d.tar.gz manaplus-004f4e8ad24087051cafd5b79e9abfafa577f24d.tar.bz2 manaplus-004f4e8ad24087051cafd5b79e9abfafa577f24d.tar.xz manaplus-004f4e8ad24087051cafd5b79e9abfafa577f24d.zip |
Add safeDraw method into scrollarea.
Diffstat (limited to 'src/gui/widgets/scrollarea.cpp')
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 99 |
1 files changed, 57 insertions, 42 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 924546329..3da38aaeb 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -318,63 +318,78 @@ void ScrollArea::draw(Graphics *graphics) BLOCK_START("ScrollArea::draw") if (mVBarVisible || mHBarVisible) { - if (isBatchDrawRenders(openGLMode)) - { - if (!mOpaque) - updateCalcFlag(graphics); - // need add caching or remove calc calls. -// if (mRedraw) - { - mVertexes->clear(); - if (mVBarVisible) - { - if (mShowButtons) - { - calcButton(graphics, UP); - calcButton(graphics, DOWN); - } - calcVBar(graphics); - calcVMarker(graphics); - } - - if (mHBarVisible) - { - if (mShowButtons) - { - calcButton(graphics, LEFT); - calcButton(graphics, RIGHT); - } - calcHBar(graphics); - calcHMarker(graphics); - } - graphics->finalize(mVertexes); - } - graphics->drawTileCollection(mVertexes); - } - else + if (!mOpaque) + updateCalcFlag(graphics); + // need add caching or remove calc calls. +// if (mRedraw) { + mVertexes->clear(); if (mVBarVisible) { if (mShowButtons) { - drawButton(graphics, UP); - drawButton(graphics, DOWN); + calcButton(graphics, UP); + calcButton(graphics, DOWN); } - drawVBar(graphics); - drawVMarker(graphics); + calcVBar(graphics); + calcVMarker(graphics); } if (mHBarVisible) { if (mShowButtons) { - drawButton(graphics, LEFT); - drawButton(graphics, RIGHT); + calcButton(graphics, LEFT); + calcButton(graphics, RIGHT); } - drawHBar(graphics); - drawHMarker(graphics); + calcHBar(graphics); + calcHMarker(graphics); } + graphics->finalize(mVertexes); + } + graphics->drawTileCollection(mVertexes); + } + + updateAlpha(); + + if (mRedraw) + { + const bool redraw = graphics->getRedraw(); + graphics->setRedraw(true); + drawChildren(graphics); + graphics->setRedraw(redraw); + } + else + { + drawChildren(graphics); + } + mRedraw = false; + BLOCK_END("ScrollArea::draw") +} + +void ScrollArea::safeDraw(Graphics *graphics) +{ + BLOCK_START("ScrollArea::draw") + if (mVBarVisible) + { + if (mShowButtons) + { + drawButton(graphics, UP); + drawButton(graphics, DOWN); + } + drawVBar(graphics); + drawVMarker(graphics); + } + + if (mHBarVisible) + { + if (mShowButtons) + { + drawButton(graphics, LEFT); + drawButton(graphics, RIGHT); } + drawHBar(graphics); + drawHMarker(graphics); } updateAlpha(); |