Revision: 53883
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53883
Author:   campbellbarton
Date:     2013-01-17 19:12:11 +0000 (Thu, 17 Jan 2013)
Log Message:
-----------
fix for text selection glitch, moving the mouse to the left would sometimes not 
entirely select the start of the text.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c 
2013-01-17 18:59:19 UTC (rev 53882)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c 
2013-01-17 19:12:11 UTC (rev 53883)
@@ -1447,10 +1447,10 @@
        }
        
        /* 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 @@
                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 @@
                
                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 */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to