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:
authorCampbell Barton <ideasman42@gmail.com>2019-07-01 18:47:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-07-01 18:48:58 +0300
commit016d5cf919481b18917656a774c015fd645a35bb (patch)
tree2acf5aba317729fe4d89473b8d5202abb56b8e0a /source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
parent4749edccddaeffdac47c9dee004b9a5a5a37e48d (diff)
Gizmo: support for filled circle with inner non-zero radius
Needed for changes to the scale gizmo.
Diffstat (limited to 'source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c')
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c21
1 files changed, 20 insertions, 1 deletions
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) {