From 1815225faa75eb64e83fdc9f066fcd6339502d52 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 2 Dec 2013 20:33:45 +1100 Subject: Blender Font (BLF): add length argument to string width/height functions This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR --- source/blender/editors/space_view3d/view3d_ruler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index 64b747b389b..6aa34baeac6 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -541,7 +541,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a ruler_item_as_string(ruler_item, unit, numstr, sizeof(numstr), prec); - BLF_width_and_height(blf_mono_font, numstr, &numstr_size[0], &numstr_size[1]); + BLF_width_and_height(blf_mono_font, numstr, sizeof(numstr), &numstr_size[0], &numstr_size[1]); pos[0] = co_ss[1][0] + (cap_size * 2.0f); pos[1] = co_ss[1][1] - (numstr_size[1] / 2.0f); @@ -627,7 +627,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a ruler_item_as_string(ruler_item, unit, numstr, sizeof(numstr), prec); - BLF_width_and_height(blf_mono_font, numstr, &numstr_size[0], &numstr_size[1]); + BLF_width_and_height(blf_mono_font, numstr, sizeof(numstr), &numstr_size[0], &numstr_size[1]); mid_v2_v2v2(pos, co_ss[0], co_ss[2]); -- cgit v1.2.3