Revision: 42296
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42296
Author:   nazgul
Date:     2011-11-30 15:10:44 +0000 (Wed, 30 Nov 2011)
Log Message:
-----------
Update space text's viewlines even if no text selected. It's needed for
proper positioning to cursor when switching to text datablock in case
there was no datablock opened in text editor.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_text/text_draw.c

Modified: trunk/blender/source/blender/editors/space_text/text_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_draw.c 2011-11-30 
11:16:33 UTC (rev 42295)
+++ trunk/blender/source/blender/editors/space_text/text_draw.c 2011-11-30 
15:10:44 UTC (rev 42296)
@@ -1689,6 +1689,9 @@
        int i, x, y, winx, linecount= 0, lineno= 0;
        int wraplinecount= 0, wrap_skip= 0;
 
+       if(st->lheight) st->viewlines= (int)ar->winy/st->lheight;
+       else st->viewlines= 0;
+
        /* if no text, nothing to do */
        if(!text)
                return;
@@ -1699,9 +1702,6 @@
        if(!text->curl || !text->sell || !text->lines.first || 
!text->lines.last)
                txt_clean_text(text);
        
-       if(st->lheight) st->viewlines= (int)ar->winy/st->lheight;
-       else st->viewlines= 0;
-       
        /* update rects for scroll */
        calc_text_rcts(st, ar, &scroll, &back); /* scroll will hold the entire 
bar size */
 

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

Reply via email to