From 260d2adcf1f09f66f00a7b9fc857f2cbff486b68 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Dec 2015 17:37:32 +1100 Subject: minor error in recent text-draw commit --- source/blender/editors/space_text/text_draw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index a7d27d2099f..0ffd40def90 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -67,7 +67,7 @@ typedef struct TextDrawContext { static void text_draw_context_init(const SpaceText *st, TextDrawContext *tdc) { tdc->font_id = blf_mono_font; - tdc->cwidth = st->cwidth; + tdc->cwidth = 0; tdc->lheight_dpi = st->lheight_dpi; } @@ -1398,9 +1398,11 @@ void draw_text_main(SpaceText *st, ARegion *ar) lineno++; } + text_font_begin(&tdc); - st->cwidth = BLF_fixed_width(tdc.font_id); - st->cwidth = MAX2(st->cwidth, (char)1); + + tdc.cwidth = max_ii((int)BLF_fixed_width(tdc.font_id), 1); + st->cwidth = tdc.cwidth; /* draw line numbers background */ if (st->showlinenrs) { -- cgit v1.2.3