GUI: Do not modify inversion directly in editable widget

This commit is contained in:
hax0kartik 2023-04-14 15:11:27 +05:30 committed by Eugene Sandulenko
parent 337960dc5f
commit 4d10720b5e

View File

@ -544,11 +544,14 @@ void EditableWidget::drawCaret(bool erase) {
// EditTextWidget uses that but not ListWidget. Thus, one should check
// whether we can unify the drawing in the text area first to avoid
// possible glitches due to different methods used.
_inversion = (_selOffset < 0) ? ThemeEngine::kTextInversionFocus : ThemeEngine::kTextInversionNone;
ThemeEngine::TextInversionState inversion = _inversion;
inversion = (_selOffset < 0) ? ThemeEngine::kTextInversionFocus : ThemeEngine::kTextInversionNone;
width = MIN(editRect.width() - caretOffset, width);
if (width > 0) {
g_gui.theme()->drawText(Common::Rect(x, y, x + width, y + editRect.height()), character,
_state, _drawAlign, _inversion, 0, false, _font,
_state, _drawAlign, inversion, 0, false, _font,
ThemeEngine::kFontColorNormal, true, _textDrawableArea);
}
}