Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Schittek <leon.schittek@gmx.net>2022-04-01 08:05:50 +0300
committerLeon Schittek <leon.schittek@gmx.net>2022-04-01 08:05:50 +0300
commit9a67f9173b168f1fed88ad1eb59c9e7623c1eca7 (patch)
treea1819886b2b568ad8d259e8a21a8a3c71cfb1667
parentaab9047f9d6234dc4e692cb062541f85c80cc64e (diff)
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.
-rw-r--r--source/blender/editors/interface/interface_widgets.c10
1 files 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);