From e751ee55269dbfc19a99c439f635cc36be2ed16b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Dec 2015 19:00:55 +1100 Subject: Fix minor order of init error w/ text draw --- source/blender/editors/space_text/text_draw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 0ffd40def90..16087921ab6 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1347,8 +1347,6 @@ void draw_text_main(SpaceText *st, ARegion *ar) int i, x, y, winx, linecount = 0, lineno = 0; int wraplinecount = 0, wrap_skip = 0; int margin_column_x; - /* don't draw lines below this */ - const int clip_min_y = -(int)(st->lheight_dpi - 1); /* if no text, nothing to do */ if (!text) @@ -1356,6 +1354,10 @@ void draw_text_main(SpaceText *st, ARegion *ar) /* dpi controlled line height and font size */ st->lheight_dpi = (U.widget_unit * st->lheight) / 20; + + /* don't draw lines below this */ + const int clip_min_y = -(int)(st->lheight_dpi - 1); + st->viewlines = (st->lheight_dpi) ? (int)(ar->winy - clip_min_y) / (st->lheight_dpi + TXT_LINE_SPACING) : 0; text_draw_context_init(st, &tdc); -- cgit v1.2.3