diff options
author | Johannes Schickel | 2010-04-05 12:41:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-04-05 12:41:08 +0000 |
commit | c5c40607194cb8ed598b371b62ca101c706d69b8 (patch) | |
tree | d4870d457085fcfd9b2e46c5fcb0db0bae0a9c92 /gui/editable.cpp | |
parent | 75b041364b7d75ce9ace68b74721423220aef4aa (diff) | |
download | scummvm-rg350-c5c40607194cb8ed598b371b62ca101c706d69b8.tar.gz scummvm-rg350-c5c40607194cb8ed598b371b62ca101c706d69b8.tar.bz2 scummvm-rg350-c5c40607194cb8ed598b371b62ca101c706d69b8.zip |
Commit of patch #2980691 "GSoC: GUI: Caret blink shaves pixels [...] (bug #2951681)".
svn-id: r48551
Diffstat (limited to 'gui/editable.cpp')
-rw-r--r-- | gui/editable.cpp | 8 |
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; } |