Correct vert-slide helper-line scale
authorCampbell Barton <ideasman42@gmail.com>
Sun, 5 Jul 2015 12:33:44 +0000 (22:33 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 5 Jul 2015 12:35:04 +0000 (22:35 +1000)
Was invalid in perspective view

source/blender/editors/transform/transform.c

index dcbc12f58d276da1897c47c9ca303b54ca02727a..16a1c9ec40c698b2b8d91f7f21ae61cbcc037720 100644 (file)
@@ -7273,13 +7273,17 @@ static void drawVertSlide(TransInfo *t)
                        if ((t->mval[0] != t->imval[0]) ||
                            (t->mval[1] != t->imval[1]))
                        {
-                               float zfac = ED_view3d_calc_zfac(t->ar->regiondata, curr_sv->co_orig_3d, NULL);
+                               float zfac;
                                float mval_ofs[2];
+                               float co_orig_3d[3];
                                float co_dest_3d[3];
 
                                mval_ofs[0] = t->mval[0] - t->imval[0];
                                mval_ofs[1] = t->mval[1] - t->imval[1];
 
+                               mul_v3_m4v3(co_orig_3d, t->obedit->obmat, curr_sv->co_orig_3d);
+                               zfac = ED_view3d_calc_zfac(t->ar->regiondata, co_orig_3d, NULL);
+
                                ED_view3d_win_to_delta(t->ar, mval_ofs, co_dest_3d, zfac);
 
                                invert_m4_m4(t->obedit->imat, t->obedit->obmat);