[Bf-blender-cvs] [016d5cf9194] master: Gizmo: support for filled circle with inner non-zero radius

Campbell Barton noreply at git.blender.org
Mon Jul 1 17:50:41 CEST 2019


Commit: 016d5cf919481b18917656a774c015fd645a35bb
Author: Campbell Barton
Date:   Tue Jul 2 01:47:51 2019 +1000
Branches: master
https://developer.blender.org/rB016d5cf919481b18917656a774c015fd645a35bb

Gizmo: support for filled circle with inner non-zero radius

Needed for changes to the scale gizmo.

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

M	source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c

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

diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
index 31e30a0dd1a..6d8ab096a26 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
@@ -129,7 +129,26 @@ static void dial_geom_draw(const float color[4],
   immUniformColor4fv(color);
 
   if (filled) {
-    imm_draw_circle_fill_2d(pos, 0, 0, 1.0, DIAL_RESOLUTION);
+    if (arc_partial_angle == 0.0f) {
+      if (arc_inner_factor == 0.0f) {
+        imm_draw_circle_fill_2d(pos, 0, 0, 1.0, DIAL_RESOLUTION);
+      }
+      else {
+        imm_draw_disk_partial_fill_2d(
+            pos, 0, 0, arc_inner_factor, 1.0f, DIAL_RESOLUTION, 0, RAD2DEGF(M_PI * 2));
+      }
+    }
+    else {
+      float arc_partial_deg = RAD2DEGF((M_PI * 2) - arc_partial_angle);
+      imm_draw_disk_partial_fill_2d(pos,
+                                    0,
+                                    0,
+                                    arc_inner_factor,
+                                    1.0f,
+                                    DIAL_RESOLUTION,
+                                    -arc_partial_deg / 2,
+                                    arc_partial_deg);
+    }
   }
   else {
     if (arc_partial_angle == 0.0f) {



More information about the Bf-blender-cvs mailing list