summaryrefslogtreecommitdiff
path: root/plugingui/lineedit.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2014-12-05 21:56:10 +0100
committerJonas Suhr Christensen <jsc@umbraculum.org>2014-12-05 21:56:10 +0100
commit27d50151320e2bc23aa0f7629ddf042543eb909b (patch)
treec2e0a102b137f24e3e6af902fa2bd842aa1fe2ab /plugingui/lineedit.cc
parent3d5e443e97bcc92febe3f4a3723def2d957a34ab (diff)
Marker going further than end of text.
Diffstat (limited to 'plugingui/lineedit.cc')
-rw-r--r--plugingui/lineedit.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugingui/lineedit.cc b/plugingui/lineedit.cc
index 46354bb..b8f7ca2 100644
--- a/plugingui/lineedit.cc
+++ b/plugingui/lineedit.cc
@@ -95,7 +95,6 @@ void GUI::LineEdit::buttonEvent(ButtonEvent *e)
if(e->direction == 1) {
for(int i = 0; i < (int)_visibletext.length(); i++) {
if(e->x < (int)(font.textWidth(_visibletext.substr(0, i)) + BORDER)) {
- printf("i, Offset: %d, %d\n", i, offsetpos);
pos = i + offsetpos;
break;
}
@@ -128,7 +127,8 @@ void GUI::LineEdit::keyEvent(GUI::KeyEvent *e)
} else if(e->keycode == GUI::KeyEvent::KEY_RIGHT) {
if(pos < _text.length()) pos++;
- if(offsetpos + _visibletext.length() <= pos) walkstate = WALK_RIGHT;
+ if(offsetpos + _visibletext.length() <= pos &&
+ pos < _text.length()) walkstate = WALK_RIGHT;
// else walkstate = NOOP;
} else if(e->keycode == GUI::KeyEvent::KEY_DELETE) {