From 2c7d0b3518d72a7ab0726b72f7d2137e5944f049 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Thu, 25 Aug 2005 18:06:19 +0000 Subject: Made our drawImage() method respect the clip area from the guichan graphics part. Removed some (now) obsolete code. Fixed compilation errors. --- src/gui/slider.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/gui/slider.cpp') diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp index 088b2794..98efc409 100644 --- a/src/gui/slider.cpp +++ b/src/gui/slider.cpp @@ -106,10 +106,8 @@ void Slider::draw(gcn::Graphics *graphics) { int w = getWidth(); int h = getHeight(); - int x, y; - getAbsolutePosition(x, y); - - y += (h - hStart->getHeight()) / 2; + int x = 0; + int y = (h - hStart->getHeight()) / 2; dynamic_cast(graphics)->drawImage(hStart, x, y); @@ -127,12 +125,6 @@ void Slider::draw(gcn::Graphics *graphics) void Slider::drawMarker(gcn::Graphics *graphics) { - int h = getHeight(); - int x, y; - getAbsolutePosition(x, y); - - x += getMarkerPosition(); - y += (h - hGrip->getHeight()) / 2; - - dynamic_cast(graphics)->drawImage(hGrip, x, y); + dynamic_cast(graphics)->drawImage(hGrip, + getMarkerPosition(), (getHeight() - hGrip->getHeight()) / 2); } -- cgit v1.2.3-70-g09d2