diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 23:12:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 23:12:11 +0400 |
commit | 8a0ad8f8b5b76f5fe69c628c9e564e0231cc0576 (patch) | |
tree | 3fb047db57c5eff0c17238ba26ce7f1fc060700c /source/blender | |
parent | 2b80a7d5dab0d611bd13909cfbf5524d1ef13b8a (diff) |
fix for text selection glitch, moving the mouse to the left would sometimes not entirely select the start of the text.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index dc87a23cd54..7abccb17818 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1447,10 +1447,10 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, con } /* mouse dragged outside the widget to the left */ - if (x < startx && but->ofs > 0) { + if (x < startx) { int i = but->ofs; - origstr[but->ofs] = 0; + origstr[but->ofs] = '\0'; while (i > 0) { if (BLI_str_cursor_step_prev_utf8(origstr, but->ofs, &i)) { @@ -1467,7 +1467,7 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, con but->pos = but->ofs; } /* mouse inside the widget, mouse coords mapped in widget space */ - else if (x >= startx) { + else { /* (x >= startx) */ int pos_i; /* keep track of previous distance from the cursor to the char */ @@ -1476,7 +1476,7 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, con but->pos = pos_prev = strlen(origstr) - but->ofs; - while (TRUE) { + while (true) { cdist = startx + BLF_width(fstyle->uifont_id, origstr + but->ofs); /* check if position is found */ |