From d140acf34e54b5878db2a5b947353da60eaa4b2c Mon Sep 17 00:00:00 2001 From: PeterN Date: Sun, 25 Jun 2023 19:32:53 +0100 Subject: [PATCH] Fix: Setting tree lines drawn incorrectly for RTL languages. (#11070) --- src/settings_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 4e8384fddb..62fce17f55 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1161,7 +1161,7 @@ uint BaseSettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int if (cur_row >= max_row) return cur_row; bool rtl = _current_text_dir == TD_RTL; - int offset = (rtl ? -(int)_circle_size.width : _circle_size.width) / 2; + int offset = (rtl ? -(int)_circle_size.width : (int)_circle_size.width) / 2; int level_width = rtl ? -WidgetDimensions::scaled.hsep_indent : WidgetDimensions::scaled.hsep_indent; int x = rtl ? right : left; @@ -1179,7 +1179,7 @@ uint BaseSettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int int bottom_y = (flags & SEF_LAST_FIELD) ? halfway_y : y + SETTING_HEIGHT - 1; GfxDrawLine(x + offset, y, x + offset, bottom_y, colour); /* Small horizontal line from the last vertical line */ - GfxDrawLine(x + offset, halfway_y, x + level_width - WidgetDimensions::scaled.hsep_normal, halfway_y, colour); + GfxDrawLine(x + offset, halfway_y, x + level_width - (rtl ? -WidgetDimensions::scaled.hsep_normal : WidgetDimensions::scaled.hsep_normal), halfway_y, colour); x += level_width; this->DrawSetting(settings_ptr, rtl ? left : x, rtl ? x : right, y, this == selected);