Fix: Setting tree lines drawn incorrectly for RTL languages. (#11070)
This commit is contained in:
@@ -1161,7 +1161,7 @@ uint BaseSettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int
|
|||||||
if (cur_row >= max_row) return cur_row;
|
if (cur_row >= max_row) return cur_row;
|
||||||
|
|
||||||
bool rtl = _current_text_dir == TD_RTL;
|
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 level_width = rtl ? -WidgetDimensions::scaled.hsep_indent : WidgetDimensions::scaled.hsep_indent;
|
||||||
|
|
||||||
int x = rtl ? right : left;
|
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;
|
int bottom_y = (flags & SEF_LAST_FIELD) ? halfway_y : y + SETTING_HEIGHT - 1;
|
||||||
GfxDrawLine(x + offset, y, x + offset, bottom_y, colour);
|
GfxDrawLine(x + offset, y, x + offset, bottom_y, colour);
|
||||||
/* Small horizontal line from the last vertical line */
|
/* 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;
|
x += level_width;
|
||||||
|
|
||||||
this->DrawSetting(settings_ptr, rtl ? left : x, rtl ? x : right, y, this == selected);
|
this->DrawSetting(settings_ptr, rtl ? left : x, rtl ? x : right, y, this == selected);
|
||||||
|
Reference in New Issue
Block a user