From da9748fb212c3ab5b8f613095310d3761d1fa87b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Dec 2017 17:42:39 -0600 Subject: [PATCH] Fix Planner::unskew parity with skew --- Marlin/planner.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/planner.h b/Marlin/planner.h index 57160748d..3ede113c2 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -349,8 +349,8 @@ class Planner { FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) { if (WITHIN(cx, X_MIN_POS + 1, X_MAX_POS) && WITHIN(cy, Y_MIN_POS + 1, Y_MAX_POS)) { - const float sx = cx - (cy * xy_skew_factor) - (cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor))), - sy = cy - (cz * yz_skew_factor); + const float sx = cx - cy * xy_skew_factor - cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor)), + sy = cy - cz * yz_skew_factor; if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { cx = sx; cy = sy; } @@ -359,7 +359,7 @@ class Planner { FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) { if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) { - const float sx = cx + cy * xy_skew_factor + cz * xz_skew_factor, + const float sx = cx + cy * xy_skew_factor + cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor)), sy = cy + cz * yz_skew_factor; if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) { cx = sx; cy = sy;