summaryrefslogtreecommitdiff
path: root/plugingui/lineedit.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-12-05 22:00:20 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2014-12-05 22:00:20 +0100
commit2f0031441c39066b52cfed629d12c310989515fe (patch)
treea6c1096a0de7b155ad9ebeca64bf4a9639269648 /plugingui/lineedit.cc
parentab219f07688e3e74ae1bc8cc9aa8148ec5beec06 (diff)
parent27d50151320e2bc23aa0f7629ddf042543eb909b (diff)
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
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) {