aboutsummaryrefslogtreecommitdiff
path: root/gui/editable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/editable.cpp')
-rw-r--r--gui/editable.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/gui/editable.cpp b/gui/editable.cpp
index 2b08b91fd2..b907408873 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -249,6 +249,14 @@ void EditableWidget::drawCaret(bool erase) {
g_gui.theme()->drawCaret(Common::Rect(x, y, x + 1, y + editRect.height() - 2), erase);
+ if (erase) {
+ if ((uint)_caretPos < _editString.size()) {
+ GUI::EditableWidget::String chr(_editString[_caretPos]);
+ int chrWidth = g_gui.getCharWidth(_editString[_caretPos], _font);
+ g_gui.theme()->drawText(Common::Rect(x, y, x + chrWidth, y + editRect.height() - 2), chr, _state, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone, 0, false, _font);
+ }
+ }
+
_caretVisible = !erase;
}