From 1a6b16b7047b8558a5870318190b038b2b81556f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 7 Nov 2013 00:17:56 +0300 Subject: redraw cached children if scrollarea position was changed. --- src/gui/widgets/scrollarea.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/scrollarea.cpp') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 948014cca..e97dad715 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -315,7 +315,19 @@ void ScrollArea::draw(gcn::Graphics *graphics) } updateAlpha(); - drawChildren(graphics); + + if (mRedraw) + { + Graphics *g = static_cast(graphics); + const bool redraw = g->getRedraw(); + g->setRedraw(true); + drawChildren(graphics); + g->setRedraw(redraw); + } + else + { + drawChildren(graphics); + } mRedraw = false; BLOCK_END("ScrollArea::draw") } @@ -787,6 +799,7 @@ void ScrollArea::mouseReleased(gcn::MouseEvent& event) } } gcn::ScrollArea::mouseReleased(event); + mRedraw = true; } void ScrollArea::mouseDragged(gcn::MouseEvent &event) @@ -830,6 +843,7 @@ void ScrollArea::mouseDragged(gcn::MouseEvent &event) } event.consume(); + mRedraw = true; } gcn::Rectangle ScrollArea::getVerticalBarDimension() const -- cgit v1.2.3-70-g09d2