From 81a12b2fac28238f84234f7bb21d4e5462a6438e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 20 Jan 2018 15:22:38 -0600 Subject: [PATCH] Relative movements fix --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ecd3dfc07..4d633ef4d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3112,8 +3112,10 @@ static void homeaxis(const AxisEnum axis) { void gcode_get_destination() { LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { - const float v = parser.value_axis_units((AxisEnum)i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0); - destination[i] = i == E_AXIS ? v : LOGICAL_TO_NATIVE(v, i); + const float v = parser.value_axis_units((AxisEnum)i); + destination[i] = (axis_relative_modes[i] || relative_mode) + ? current_position[i] + v + : (i == E_AXIS) ? v : LOGICAL_TO_NATIVE(v, i); } else destination[i] = current_position[i];