diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-12-01 09:37:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-12-01 09:56:06 +0300 |
commit | 260d2adcf1f09f66f00a7b9fc857f2cbff486b68 (patch) | |
tree | 6922d4db08058f6faab7151f5e83e6a202d6762c /source/blender/editors/space_text/text_draw.c | |
parent | 6783c673e6457399ef2cb0c5ee65fcfe8a1d07f0 (diff) |
minor error in recent text-draw commit
Diffstat (limited to 'source/blender/editors/space_text/text_draw.c')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 8 |
1 files changed, 5 insertions, 3 deletions
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) { |