diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-26 16:01:14 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-26 16:01:14 +0200 |
commit | 02d6bcd53e06e1caeb335bd9b12bb16cc982d656 (patch) | |
tree | 37ac4f0f57d6d293bad24332d14e31b1cbb06f1d /src/gui | |
parent | 0a62226b1cc9c1b01ddab4feb9095ed7a5ba3e48 (diff) | |
download | manaplus-02d6bcd53e06e1caeb335bd9b12bb16cc982d656.tar.gz manaplus-02d6bcd53e06e1caeb335bd9b12bb16cc982d656.tar.bz2 manaplus-02d6bcd53e06e1caeb335bd9b12bb16cc982d656.tar.xz manaplus-02d6bcd53e06e1caeb335bd9b12bb16cc982d656.zip |
Fix scrollbar regression.
Yes, code look like hack, but it working.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 16 | ||||
-rw-r--r-- | src/gui/widgets/scrollarea.h | 2 |
2 files changed, 15 insertions, 3 deletions
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 |