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

svn-id: r35519
This commit is contained in:
Jordi Vilalta Prat 2008-12-24 01:11:58 +00:00
parent 1c238fe1e1
commit bce76931d3
2 changed files with 6 additions and 1 deletions

View File

@ -328,7 +328,11 @@ void SliderWidget::handleMouseWheel(int x, int y, int direction) {
}
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) {

View File

@ -236,6 +236,7 @@ protected:
int valueToPos(int value);
int posToValue(int pos);
int valueToBarWidth(int value);
};
/* GraphicsWidget */