[Scummvm-cvs-logs] SF.net SVN: scummvm:[35519] scummvm/trunk/gui

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Wed Dec 24 02:11:58 CET 2008


Revision: 35519
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35519&view=rev
Author:   jvprat
Date:     2008-12-24 01:11:58 +0000 (Wed, 24 Dec 2008)

Log Message:
-----------
Added valueToBarWidth to calculate SliderWidget's bar width like it was done before (as discussed with LordHoto)

Modified Paths:
--------------
    scummvm/trunk/gui/widget.cpp
    scummvm/trunk/gui/widget.h

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2008-12-24 00:18:58 UTC (rev 35518)
+++ scummvm/trunk/gui/widget.cpp	2008-12-24 01:11:58 UTC (rev 35519)
@@ -328,9 +328,13 @@
 }
 
 void SliderWidget::drawWidget() {
-	g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToPos(_value) + 1, _state);
+	g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(_value), _state);
 }
 
+int SliderWidget::valueToBarWidth(int value) {
+	return (_w * (value - _valueMin) / (_valueMax - _valueMin));
+}
+
 int SliderWidget::valueToPos(int value) {
 	return ((_w - 1) * (value - _valueMin + 1) / (_valueMax - _valueMin));
 }

Modified: scummvm/trunk/gui/widget.h
===================================================================
--- scummvm/trunk/gui/widget.h	2008-12-24 00:18:58 UTC (rev 35518)
+++ scummvm/trunk/gui/widget.h	2008-12-24 01:11:58 UTC (rev 35519)
@@ -236,6 +236,7 @@
 
 	int valueToPos(int value);
 	int posToValue(int pos);
+	int valueToBarWidth(int value);
 };
 
 /* GraphicsWidget */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list