From 43ea2d2b2f8abe3b9a494e13e60efe3f2c0d573d Mon Sep 17 00:00:00 2001 From: ousnius Date: Sat, 8 Oct 2016 02:58:08 +0200 Subject: [PATCH] Adjust origin for non-uniform scaling with transform tool --- src/components/TweakBrush.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/TweakBrush.cpp b/src/components/TweakBrush.cpp index 448fddfd..82a805cc 100644 --- a/src/components/TweakBrush.cpp +++ b/src/components/TweakBrush.cpp @@ -1097,6 +1097,7 @@ void TB_XForm::brushAction(mesh* m, TweakPickInfo& pickInfo, int* points, int nP xform.PushTranslate(pick.center * -1.0f); } else if (xformType == 2) { + xform.PushTranslate(pick.center); Vector3 dist(1.0f, 1.0f, 1.0f); if (fabs(dv.x) > EPSILON) dist.x = fabs(1.0f + dv.x / 10.0f); @@ -1105,7 +1106,8 @@ void TB_XForm::brushAction(mesh* m, TweakPickInfo& pickInfo, int* points, int nP else if (fabs(dv.z) > EPSILON) dist.z = fabs(1.0f + dv.z / 10.0f); - xform.Scale(dist.x, dist.y, dist.z); + xform.PushScale(dist.x, dist.y, dist.z); + xform.PushTranslate(pick.center * -1.0f); } else if (xformType == 3) { xform.PushTranslate(pick.center);