mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
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:
parent
1c238fe1e1
commit
bce76931d3
@ -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) {
|
||||
|
@ -236,6 +236,7 @@ protected:
|
||||
|
||||
int valueToPos(int value);
|
||||
int posToValue(int pos);
|
||||
int valueToBarWidth(int value);
|
||||
};
|
||||
|
||||
/* GraphicsWidget */
|
||||
|
Loading…
x
Reference in New Issue
Block a user