diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-30 19:10:44 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-30 19:10:44 +0400 |
commit | 343c2bb5aa8cc9c72f94c59a8b4a3bd39a67b8ff (patch) | |
tree | ad478b46dcc1ca007824eeed0c3617bbb0ecfb48 /source/blender | |
parent | ed65c463322ba1a1e110366eb121160a0f77586c (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 2465d42bbf1..637c8fcdbcf 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1689,6 +1689,9 @@ void draw_text_main(SpaceText *st, ARegion *ar) 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 @@ void draw_text_main(SpaceText *st, ARegion *ar) 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 */ |