From ddab1533c550341371f318d36293d9e0b9657ff9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Nov 2017 15:41:56 -0600 Subject: [PATCH] Simplify midpos calculation --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e27e41a76..39dc5dc44 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10922,7 +10922,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n if (!no_move) { const float parkingposx[] = PARKING_EXTRUDER_PARKING_X, - midpos = ((parkingposx[1] - parkingposx[0])/2) + parkingposx[0] + hotend_offset[X_AXIS][active_extruder], + midpos = (parkingposx[0] + parkingposx[1]) * 0.5 + hotend_offset[X_AXIS][active_extruder], grabpos = parkingposx[tmp_extruder] + hotend_offset[X_AXIS][active_extruder] + (tmp_extruder == 0 ? -(PARKING_EXTRUDER_GRAB_DISTANCE) : PARKING_EXTRUDER_GRAB_DISTANCE); /**