summaryrefslogtreecommitdiff
path: root/src/gui/scrollarea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/scrollarea.cpp')
-rw-r--r--src/gui/scrollarea.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 43b27f23..156ff054 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -217,12 +217,12 @@ void ScrollArea::draw(gcn::Graphics *graphics)
void ScrollArea::drawFrame(gcn::Graphics *graphics)
{
- int bs = getFrameSize();
- int w = getWidth() + bs * 2;
- int h = getHeight() + bs * 2;
-
if (mOpaque)
{
+ const int bs = getFrameSize();
+ const int w = getWidth() + bs * 2;
+ const int h = getHeight() + bs * 2;
+
static_cast<Graphics*>(graphics)->
drawImageRect(0, 0, w, h, background);
}
@@ -232,14 +232,7 @@ void ScrollArea::setOpaque(bool opaque)
{
mOpaque = opaque;
- if (mOpaque)
- {
- setFrameSize(2);
- }
- else
- {
- setFrameSize(0);
- }
+ setFrameSize(mOpaque ? 2 : 0);
}
void ScrollArea::drawButton(gcn::Graphics *graphics, BUTTON_DIR dir)