[Bf-blender-cvs] [854f73b4a23] master: Fix T78592: Shear operator fails to affect curve control point handles

Germano Cavalcante noreply at git.blender.org
Wed Aug 5 20:06:44 CEST 2020


Commit: 854f73b4a2317e026b3d6f8c3598d9bded09337b
Author: Germano Cavalcante
Date:   Wed Aug 5 15:06:23 2020 -0300
Branches: master
https://developer.blender.org/rB854f73b4a2317e026b3d6f8c3598d9bded09337b

Fix T78592: Shear operator fails to affect curve control point handles

Use `td->iloc` as the coordinates of the transformed element.

It is more accurate and other transformation modes, such as scale, also
operate on `td->iloc`.

===================================================================

M	source/blender/editors/transform/transform_mode_shear.c

===================================================================

diff --git a/source/blender/editors/transform/transform_mode_shear.c b/source/blender/editors/transform/transform_mode_shear.c
index fa33c1550e7..e508a1fa4c2 100644
--- a/source/blender/editors/transform/transform_mode_shear.c
+++ b/source/blender/editors/transform/transform_mode_shear.c
@@ -164,7 +164,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2]))
   FOREACH_TRANS_DATA_CONTAINER (t, tc) {
     TransData *td = tc->data;
     for (i = 0; i < tc->data_len; i++, td++) {
-      const float *center, *co;
+      const float *center;
       if (td->flag & TD_SKIP) {
         continue;
       }
@@ -178,19 +178,15 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2]))
 
       if (is_local_center) {
         center = td->center;
-        co = td->loc;
       }
       else {
         center = tc->center_local;
-        co = td->center;
       }
 
-      sub_v3_v3v3(vec, co, center);
-
+      sub_v3_v3v3(vec, td->iloc, center);
       mul_m3_v3(tmat, vec);
-
       add_v3_v3(vec, center);
-      sub_v3_v3(vec, co);
+      sub_v3_v3(vec, td->iloc);
 
       if (t->options & CTX_GPENCIL_STROKES) {
         /* grease pencil multiframe falloff */



More information about the Bf-blender-cvs mailing list