[Bf-blender-cvs] [9a67f9173b1] master: Cleanup: Improve variable naming

Leon Schittek noreply at git.blender.org
Fri Apr 1 07:06:32 CEST 2022


Commit: 9a67f9173b168f1fed88ad1eb59c9e7623c1eca7
Author: Leon Schittek
Date:   Fri Apr 1 07:05:50 2022 +0200
Branches: master
https://developer.blender.org/rB9a67f9173b168f1fed88ad1eb59c9e7623c1eca7

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.

===================================================================

M	source/blender/editors/interface/interface_widgets.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list