aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-05-17 06:19:11 +0000
committerTorbjörn Andersson2005-05-17 06:19:11 +0000
commit99ef35bdd4a0a18b96e2fde71dbf546a4cf40e73 (patch)
tree583cc8212fa32886148cf7de51eedb7eb178ebc6
parente4ac8cb870ead3902bfaf652d8656aa88e45e9a2 (diff)
downloadscummvm-rg350-99ef35bdd4a0a18b96e2fde71dbf546a4cf40e73.tar.gz
scummvm-rg350-99ef35bdd4a0a18b96e2fde71dbf546a4cf40e73.tar.bz2
scummvm-rg350-99ef35bdd4a0a18b96e2fde71dbf546a4cf40e73.zip
Fixed caret regression in editable text fields.
svn-id: r18133
-rw-r--r--gui/editable.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/gui/editable.cpp b/gui/editable.cpp
index 3cac9d487c..b9a40af981 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -35,7 +35,7 @@ EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h)
_editScrollOffset = 0;
- _font = &(g_gui.getFont()); // Most widgets will probably set this to something else.
+ _font = &g_gui.getFont(); // Most widgets will probably set this to something else.
}
EditableWidget::~EditableWidget() {
@@ -148,18 +148,18 @@ void EditableWidget::drawCaret(bool erase) {
int16 color = (erase ^ _caretInverse) ? g_gui._bgcolor : g_gui._textcolorhi;
int x = editRect.left;
- int y = editRect.top;
+ int y = editRect.top + 1;
x += getCaretOffset();
- if (y < 0 || y + editRect.height() >= _h)
+ if (y < 0 || y + editRect.height() - 2 >= _h)
return;
x += getAbsX();
y += getAbsY();
- g_gui.vLine(x, y, y + editRect.height(), color);
- g_gui.addDirtyRect(x, y, 2, editRect.height());
+ g_gui.vLine(x, y, y + editRect.height() - 2, color);
+ g_gui.addDirtyRect(x, y, 2, editRect.height() - 2);
_caretVisible = !erase;
}