From 6a722570f1afe857c083177fd1357e87961c4a9b Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 22 Feb 2023 13:22:45 +0100 Subject: [PATCH] #9722 - GCodeViewer - Take in account z offset when setting the height of the toolpaths for the purge line in custom start gcode. --- src/libslic3r/GCode/GCodeProcessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 6db0492d0..555aab0c1 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2402,7 +2402,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line) if (m_forced_height > 0.0f) m_height = m_forced_height; else if (m_layer_id == 0) - m_height = (m_end_position[Z] <= double(m_first_layer_height)) ? m_end_position[Z] : m_first_layer_height; + m_height = std::min((float)m_end_position[Z], m_first_layer_height + m_z_offset); else if (line.comment() != INTERNAL_G2G3_TAG){ if (m_end_position[Z] > m_extruded_last_z + EPSILON && delta_pos[Z] == 0.0) m_height = m_end_position[Z] - m_extruded_last_z;