aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/EditTextWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp
index 6ae43d0100..66dc654b8f 100644
--- a/gui/EditTextWidget.cpp
+++ b/gui/EditTextWidget.cpp
@@ -142,8 +142,8 @@ void EditTextWidget::drawCaret(bool erase) {
for (int i = 0; i < _pos; i++)
width += gui->getCharWidth(_label[i]);
- if (width > _w - 6)
- width = _w - 6;
+ if (gui->getStringWidth(_label) - (_w - 6) > 0)
+ width -= gui->getStringWidth(_label) - (_w - 6);
x += width;
gui->vline(x, y, y + kLineHeight, color);