diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-08-15 14:29:34 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-08-15 14:29:49 +0300 |
commit | 95a0144293b840bfbdcb6a41c1a3a26976961b9b (patch) | |
tree | e6c0f2bca029e95aadd4717ac307c00cd8da7749 /source | |
parent | 9e54e6bdc57911be2911a7537ab9f67d87e31df0 (diff) |
Fix T68684: Vertex snapping with median not working if the object is not at center of the world
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index d45a0588003..dbcc6c1b04a 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1150,12 +1150,19 @@ static void TargetSnapMedian(TransInfo *t) add_v3_v3(v, td->center); } + if (i == 0) { + /* Is this possible? */ + continue; + } + + mul_v3_fl(v, 1.0 / i); + if (tc->use_local_mat) { mul_m4_v3(tc->mat, v); } add_v3_v3(t->tsnap.snapTarget, v); - i_accum += i; + i_accum++; } mul_v3_fl(t->tsnap.snapTarget, 1.0 / i_accum); |