summaryrefslogtreecommitdiff
path: root/src/gui/scrollarea.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-25 18:06:19 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-25 18:06:19 +0000
commit2c7d0b3518d72a7ab0726b72f7d2137e5944f049 (patch)
tree7080b1e32df54b8b44875df3609e94888939eb89 /src/gui/scrollarea.cpp
parent529ba0581833b05921d8dc3336b02a3c6abd511a (diff)
downloadmana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.gz
mana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.bz2
mana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.tar.xz
mana-2c7d0b3518d72a7ab0726b72f7d2137e5944f049.zip
Made our drawImage() method respect the clip area from the guichan graphics part. Removed some (now) obsolete code. Fixed compilation errors.
Diffstat (limited to 'src/gui/scrollarea.cpp')
-rw-r--r--src/gui/scrollarea.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 6bc428e2..ec8a7946 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -216,16 +216,13 @@ void ScrollArea::draw(gcn::Graphics *graphics)
void ScrollArea::drawBorder(gcn::Graphics *graphics)
{
- int x, y, w, h, bs;
- getAbsolutePosition(x, y);
+ int w, h, bs;
bs = getBorderSize();
w = getWidth() + bs * 2;
h = getHeight() + bs * 2;
- x -= bs;
- y -= bs;
if (isOpaque()) {
- dynamic_cast<Graphics*>(graphics)->drawImageRect(x, y, w, h, background);
+ dynamic_cast<Graphics*>(graphics)->drawImageRect(0, 0, w, h, background);
}
}
@@ -248,11 +245,9 @@ bool ScrollArea::isOpaque()
void ScrollArea::drawButton(gcn::Graphics *graphics, BUTTON_DIR dir)
{
- int x, y, state = 0;
+ int state = 0;
gcn::Rectangle dim;
- getAbsolutePosition(x,y);
-
switch(dir) {
case UP:
state = mUpButtonPressed ? 1 : 0;
@@ -273,7 +268,7 @@ void ScrollArea::drawButton(gcn::Graphics *graphics, BUTTON_DIR dir)
}
dynamic_cast<Graphics*>(graphics)->drawImage(
- buttons[dir][state], x + dim.x, y + dim.y);
+ buttons[dir][state], dim.x, dim.y);
}
void ScrollArea::drawUpButton(gcn::Graphics *graphics)
@@ -314,20 +309,16 @@ void ScrollArea::drawHBar(gcn::Graphics *graphics)
void ScrollArea::drawVMarker(gcn::Graphics *graphics)
{
- int x, y;
gcn::Rectangle dim = getVerticalMarkerDimension();
- getAbsolutePosition(x, y);
dynamic_cast<Graphics*>(graphics)->drawImageRect(
- x + dim.x, y + dim.y, dim.width, dim.height, vMarker);
+ dim.x, dim.y, dim.width, dim.height, vMarker);
}
void ScrollArea::drawHMarker(gcn::Graphics *graphics)
{
- int x, y;
gcn::Rectangle dim = getHorizontalMarkerDimension();
- getAbsolutePosition(x, y);
dynamic_cast<Graphics*>(graphics)->drawImageRect(
- x + dim.x, y + dim.y, dim.width, dim.height, vMarker);
+ dim.x, dim.y, dim.width, dim.height, vMarker);
}