From 0702e0de6e1cc22a3c8af6d0d40f35e23564a2b6 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 26 Jan 2020 17:12:27 +0100 Subject: [PATCH] Use world2machine instead of repeating code --- Firmware/planner.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index 8c26cef9b..197b3d9f9 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -1345,14 +1345,7 @@ void plan_set_position(float x, float y, float z, const float &e) apply_rotation_xyz(plan_bed_level_matrix, x, y, z); #endif // ENABLE_AUTO_BED_LEVELING - // Apply the machine correction matrix. - if (world2machine_correction_mode != WORLD2MACHINE_CORRECTION_NONE) - { - float tmpx = x; - float tmpy = y; - x = world2machine_rotation_and_skew[0][0] * tmpx + world2machine_rotation_and_skew[0][1] * tmpy + world2machine_shift[0]; - y = world2machine_rotation_and_skew[1][0] * tmpx + world2machine_rotation_and_skew[1][1] * tmpy + world2machine_shift[1]; - } + world2machine(x, y); position[X_AXIS] = lround(x*cs.axis_steps_per_unit[X_AXIS]); position[Y_AXIS] = lround(y*cs.axis_steps_per_unit[Y_AXIS]);