diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-22 00:42:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-22 00:52:33 +0300 |
commit | d00f54e574ccb6c580109ba865ce2e9511510a5e (patch) | |
tree | 02a8f45e3002e8697b53de78ca3aa47237755f73 /source/blender/editors/transform | |
parent | 4d4ae491c8098001700c23b805f7514fd56941f3 (diff) |
Transform: redo resize now constrains axis values
Before 1bfbfa281046b this wasn't essential because the constraints
prevented the axes from being applied.
Now redo ignores constraints - the input values must be constrained.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index cddd25252a4..e4967e172eb 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -3824,9 +3824,15 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2])) } size_to_mat3(mat, t->values); - - if (t->con.applySize) { + if (t->con.mode & CON_APPLY) { t->con.applySize(t, NULL, NULL, mat); + + /* Only so we have re-usable value with redo. */ + for (i = 0; i < 3; i++) { + if (!(t->con.mode & (CON_AXIS0 << i))) { + t->values[i] = 1.0f; + } + } } copy_m3_m3(t->mat, mat); // used in gizmo @@ -3850,8 +3856,9 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2])) if (t->flag & T_CLIP_UV && clipUVTransform(t, t->values, 1)) { size_to_mat3(mat, t->values); - if (t->con.applySize) + if (t->con.mode & CON_APPLY) { t->con.applySize(t, NULL, NULL, mat); + } FOREACH_TRANS_DATA_CONTAINER (t, tc) { |