From 9a67f9173b168f1fed88ad1eb59c9e7623c1eca7 Mon Sep 17 00:00:00 2001 From: Leon Schittek Date: Fri, 1 Apr 2022 07:05:50 +0200 Subject: Cleanup: Improve variable naming The variable `ofs` in `widget_numslider` was referring to the radius. `rad` is more clear and consistent with the other widget functions. --- source/blender/editors/interface/interface_widgets.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ca07c97b987..a16c24f63cd 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3745,8 +3745,8 @@ static void widget_numslider( widget_init(&wtb1); /* Backdrop first. */ - const float ofs = widget_radius_from_zoom(zoom, wcol); - round_box_edges(&wtb, roundboxalign, rect, ofs); + const float rad = widget_radius_from_zoom(zoom, wcol); + round_box_edges(&wtb, roundboxalign, rect, rad); wtb.draw_outline = false; widgetbase_draw(&wtb, wcol); @@ -3803,9 +3803,9 @@ static void widget_numslider( factor_ui = factor * width; /* The rectangle width needs to be at least twice the corner radius for the round corners * to be drawn properly. */ - const float min_width = 2.0f * ofs; + const float min_width = 2.0f * rad; - if (factor_ui > width - ofs) { + if (factor_ui > width - rad) { /* Left part + middle part + right part. */ factor_discard = factor; } @@ -3821,7 +3821,7 @@ static void widget_numslider( factor_discard = factor_ui / min_width; } - round_box_edges(&wtb1, roundboxalign_slider, &rect1, ofs); + round_box_edges(&wtb1, roundboxalign_slider, &rect1, rad); wtb1.draw_outline = false; widgetbase_set_uniform_discard_factor(&wtb1, factor_discard); widgetbase_draw(&wtb1, wcol); -- cgit v1.2.3