diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-21 06:09:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-21 06:09:30 +0300 |
commit | 005d429599088b523e4f62326824c7fb51ba9c63 (patch) | |
tree | dccce15cf132bae28c85be897d5f7cc33299ea17 /src/gui | |
parent | 8037d33c9f429d4c0322da383cdda46776c3c14e (diff) | |
download | manaverse-005d429599088b523e4f62326824c7fb51ba9c63.tar.gz manaverse-005d429599088b523e4f62326824c7fb51ba9c63.tar.bz2 manaverse-005d429599088b523e4f62326824c7fb51ba9c63.tar.xz manaverse-005d429599088b523e4f62326824c7fb51ba9c63.zip |
Fix draw issue in SDL after vertex precalculation.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/button.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/tab.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 13 |
5 files changed, 23 insertions, 3 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 91d297846..c0f174b2c 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -210,6 +210,10 @@ void Button::draw(gcn::Graphics *graphics) recalc = true; mMode = mode; } + else if (static_cast<Graphics*>(graphics)->getRedraw()) + { + recalc = true; + } } if (recalc) diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 0916d9976..bbde65207 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -204,7 +204,7 @@ void ProgressBar::render(Graphics *graphics, const gcn::Rectangle &area, gcn::Font *oldFont = graphics->getFont(); gcn::Color oldColor = graphics->getColor(); - if (*redraw) + if (*redraw || graphics->getRedraw()) { *redraw = false; static_cast<Graphics*>(graphics)->calcWindow(vert, diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 0be492ee6..59e323e94 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -350,6 +350,10 @@ void ScrollArea::drawFrame(gcn::Graphics *graphics) mDrawWidth = rect.width; mDrawHeight = rect.height; } + else if (static_cast<Graphics*>(graphics)->getRedraw()) + { + recalc = true; + } } if (recalc) diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index 73ffff30e..5e4a147c0 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -190,7 +190,8 @@ void Tab::draw(gcn::Graphics *graphics) updateAlpha(); // draw tab - if (mRedraw || mode != mMode) + if (mRedraw || mode != mMode + || static_cast<Graphics*>(graphics)->getRedraw()) { mMode = mode; mRedraw = false; diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 72530db8f..df8599b95 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -131,10 +131,12 @@ void Window::draw(gcn::Graphics *graphics) return; Graphics *g = static_cast<Graphics*>(graphics); + bool update = false; if (mRedraw) { mRedraw = false; + update = true; g->calcWindow(mVertexes, 0, 0, getWidth(), getHeight(), mSkin->getBorder()); } @@ -176,7 +178,16 @@ void Window::draw(gcn::Graphics *graphics) } } - drawChildren(graphics); + if (update) + { + g->setRedraw(update); + drawChildren(graphics); + g->setRedraw(false); + } + else + { + drawChildren(graphics); + } } void Window::setContentSize(int width, int height) |