From 40531c8ad951598051ed9167bc40e7491f462b4e Mon Sep 17 00:00:00 2001 From: "salt.wei" Date: Thu, 11 Aug 2022 21:18:19 +0800 Subject: [PATCH] ENH: fix crash when add G2_G3 in start gcode Signed-off-by: salt.wei Change-Id: I7d7133122b0d7e478fd2b0fa8849be09cb0c8353 (cherry picked from commit 2095960596e85ef970016701afd201c9bd36b262) --- 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 0da0bca55..73fcb6fbb 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2998,7 +2998,7 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line) block.role = m_extrusion_role; block.distance = delta_xyz; block.g1_line_id = m_g1_line_id; - block.layer_id = m_layer_id; + block.layer_id = std::max(1, m_layer_id); // BBS: calculates block cruise feedrate // For arc move, we need to limite the cruise according to centripetal acceleration which is