From 02d6bcd53e06e1caeb335bd9b12bb16cc982d656 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Mar 2011 16:01:14 +0200 Subject: Fix scrollbar regression. Yes, code look like hack, but it working. --- src/gui/widgets/scrollarea.cpp | 16 +++++++++++++--- src/gui/widgets/scrollarea.h | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 2cc745ccd..a78048314 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -50,7 +50,9 @@ ScrollArea::ScrollArea(): mVertexes(new GraphicsVertexes()), mRedraw(true), mXOffset(0), - mYOffset(0) + mYOffset(0), + mDrawWidth(0), + mDrawHeight(0) { addWidgetListener(this); init(); @@ -65,9 +67,11 @@ ScrollArea::ScrollArea(gcn::Widget *widget): mVertexes(new GraphicsVertexes()), mRedraw(true), mXOffset(0), - mYOffset(0) + mYOffset(0), + mDrawWidth(0), + mDrawHeight(0) { - addWidgetListener(this); +// addWidgetListener(this); init(); } @@ -339,6 +343,12 @@ void ScrollArea::drawFrame(gcn::Graphics *graphics) mXOffset = rect.xOffset; mYOffset = rect.yOffset; } + else if (rect.width != mDrawWidth || rect.height != mDrawHeight) + { + recalc = true; + mDrawWidth = rect.width; + mDrawHeight = rect.height; + } } if (recalc) diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index e613170fa..0e5a8f850 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -154,6 +154,8 @@ class ScrollArea : public gcn::ScrollArea, public gcn::WidgetListener bool mRedraw; int mXOffset; int mYOffset; + int mDrawWidth; + int mDrawHeight; }; #endif -- cgit v1.2.3-70-g09d2