diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-18 04:03:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-18 06:01:20 +0300 |
commit | 8573c1a84728546e949ced6e6f198afd16ac4dc4 (patch) | |
tree | ebb7b9a9016f459cec85b284f01e3c1a270896f4 /source/blender | |
parent | b4146a04bc385a30ca9d02d89068671f48ca2233 (diff) |
Fix T29153: Rotate & scale ignore snapping points
Checking for 'Closest' here isn't needed since
TransSnap.snapTarget callback is already ensuring the selected target is the closest.
Also don't reuse the pre-calculated distance,
since its only valid to do this when there are no snap points
and this isn't a significant gain to avoid the extra calculation - run once per update.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 869f03e416a..ea07193b85b 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -803,29 +803,19 @@ static void ApplySnapTranslation(TransInfo *t, float vec[3]) static void ApplySnapRotation(TransInfo *t, float *value) { - if (t->tsnap.target == SCE_SNAP_TARGET_CLOSEST) { - *value = t->tsnap.dist; - } - else { - float point[3]; - getSnapPoint(t, point); - *value = RotationBetween(t, t->tsnap.snapTarget, point); - } + float point[3]; + getSnapPoint(t, point); + + float dist = RotationBetween(t, t->tsnap.snapTarget, point); + *value = dist; } static void ApplySnapResize(TransInfo *t, float vec[3]) { - float dist; - - if (t->tsnap.target == SCE_SNAP_TARGET_CLOSEST) { - dist = t->tsnap.dist; - } - else { - float point[3]; - getSnapPoint(t, point); - dist = ResizeBetween(t, t->tsnap.snapTarget, point); - } + float point[3]; + getSnapPoint(t, point); + float dist = ResizeBetween(t, t->tsnap.snapTarget, point); copy_v3_fl(vec, dist); } |