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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-10-08 15:45:45 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-10-08 19:39:41 +0300
commit043ddcf3ad3bdcba2c980af76202bc6f177f4b0d (patch)
treed9ebf082f18edf58eceff6dbae99833845bc578a /source/blender/editors/transform/transform_gizmo_3d.c
parent196d6166e51dc9496a8a678c329758134988eee3 (diff)
Cleanup: Simplify use of 'Snapping Gears'
This commit removes `t->snap[0]` and `t->snap_spatial[0]`. They were not actually being used, and could add overhead for transformation without snap.
Diffstat (limited to 'source/blender/editors/transform/transform_gizmo_3d.c')
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index b8aa16c0a59..017cccdee15 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -1280,7 +1280,7 @@ void drawDial3d(const TransInfo *t)
float mat_basis[4][4];
float mat_final[4][4];
float color[4];
- float increment;
+ float increment = 0.0f;
float line_with = GIZMO_AXIS_LINE_WIDTH + 1.0f;
float scale = UI_DPI_FAC * U.gizmo_size;
@@ -1335,10 +1335,7 @@ void drawDial3d(const TransInfo *t)
if (activeSnap(t) && (!transformModeUseSnap(t) ||
(t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)))) {
- increment = (t->modifiers & MOD_PRECISION) ? t->snap[2] : t->snap[1];
- }
- else {
- increment = t->snap[0];
+ increment = (t->modifiers & MOD_PRECISION) ? t->snap[1] : t->snap[0];
}
BLI_assert(axis_idx >= MAN_AXIS_RANGE_ROT_START && axis_idx < MAN_AXIS_RANGE_ROT_END);