GUI: RTL: Base support for Sliders

This commit is contained in:
aryanrawlani28 2020-05-10 15:20:45 +05:30 committed by Eugene Sandulenko
parent 8966d9dfd9
commit abd24fb1cb

View file

@ -772,7 +772,14 @@ void SliderWidget::handleMouseWheel(int x, int y, int direction) {
}
void SliderWidget::drawWidget() {
g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(_value), _state);
if (_useRTL) {
// TODO: This currently draws the numbers okay (Rightmost is 0, left goes high value), but renders incorrectly.
// Most likely, I'll draw ::Rect(_x + _w, _y, _x, _y + _h...) but I'll leave it for now, will do it when I flip individual widgets.
g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(getMaxValue() - _value), _state);
}
else {
g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(_value), _state);
}
}
int SliderWidget::valueToBarWidth(int value) {