summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/scrollarea.cpp16
-rw-r--r--src/gui/widgets/scrollarea.h2
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