From abd24fb1cb21e4d7d00e30cd6989452f41289bb8 Mon Sep 17 00:00:00 2001 From: aryanrawlani28 Date: Sun, 10 May 2020 15:20:45 +0530 Subject: [PATCH] GUI: RTL: Base support for Sliders --- gui/widget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/widget.cpp b/gui/widget.cpp index b57f9af3950..60e8c73e3f4 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -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) {