From aa802df7aa3335dfd93d4d64fc124ce3cc37e43c Mon Sep 17 00:00:00 2001 From: aryanrawlani28 Date: Mon, 25 May 2020 02:13:24 +0530 Subject: [PATCH] GUI: RTL: Fix lists being overdrawn when tooltip focused --- gui/widgets/list.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index 40a1b22de48..d925da7b054 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -572,15 +572,21 @@ void ListWidget::drawWidget() { color = _listColors[_listIndex[pos]]; } + Common::Rect r1(_x + r.left, y, _x + r.right, y + fontHeight - 2); + + if (g_gui.useRTL() && _numberingMode == kListNumberingOff && _scrollBar->isVisible()) { + r1.translate(_scrollBarWidth, 0); + } + if (_selectedItem == pos && _editMode) { buffer = _editString; color = _editColor; adjustOffset(); - g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.right, y + fontHeight - 2), buffer, _state, + g_gui.theme()->drawText(r1, buffer, _state, alignment, inverted, pad, true, ThemeEngine::kFontStyleBold, color); } else { buffer = _list[pos]; - g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.right, y + fontHeight - 2), buffer, _state, + g_gui.theme()->drawText(r1, buffer, _state, alignment, inverted, pad, true, ThemeEngine::kFontStyleBold, color); } }