Fix #25923: Active area of text editor line numbers too big
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 Feb 2011 16:28:19 +0000 (16:28 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 Feb 2011 16:28:19 +0000 (16:28 +0000)
Area with width 60px was used for determing should we jump to line or
input new cahacter. Reduce this area to actual line numbers margin width.

source/blender/editors/space_text/text_ops.c

index 7eb0ab67d8e341d29f081f9dfb5afb38e3ed5217..efb0b1735591c40398fc625290b180cd149bfdb4 100644 (file)
@@ -2576,10 +2576,12 @@ static int line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *even
        static int jump_to= 0;
        static double last_jump= 0;
 
+       text_update_character_width(st);
+
        if(!st->showlinenrs)
                return OPERATOR_PASS_THROUGH;
 
-       if(!(mval[0]>2 && mval[0]<60 && mval[1]>2 && mval[1]<ar->winy-2))
+       if(!(mval[0]>2 && mval[0]<(TXT_OFFSET + TEXTXLOC) && mval[1]>2 && mval[1]<ar->winy-2))
                return OPERATOR_PASS_THROUGH;
 
        if(!(event->ascii>='0' && event->ascii<='9'))