From a0feb0f652ecc1062a7d239bf9e4b7b6d998b3cb Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Tue, 23 Mar 2021 12:46:04 +0100 Subject: [PATCH] Preview and G-code viewer - Fixed synchronization between markers for pause print, color changes, custom g-code, retractions, deretractions and current line shown in g-code window --- src/libslic3r/GCode/GCodeProcessor.cpp | 2 +- src/slic3r/GUI/GCodeViewer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index bd4e7a3ad..a3877845f 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2572,7 +2572,7 @@ void GCodeProcessor::store_move_vertex(EMoveType type) { MoveVertex vertex = { #if ENABLE_GCODE_LINES_ID_IN_H_SLIDER - m_line_id, + (type == EMoveType::Color_change || type == EMoveType::Pause_Print || type == EMoveType::Custom_GCode) ? m_line_id + 1 : m_line_id, #endif // ENABLE_GCODE_LINES_ID_IN_H_SLIDER type, m_extrusion_role, diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index ed887d062..66bdafb56 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -3151,7 +3151,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool const Path& path = buffer->paths[path_id]; #endif // ENABLE_REDUCED_TOOLPATHS_SEGMENT_CAPS const Path::Sub_Path& sub_path = path.sub_paths[sub_path_id]; - if (m_sequential_view.current.last <= sub_path.first.s_id || sub_path.last.s_id <= m_sequential_view.current.first) + if (m_sequential_view.current.last < sub_path.first.s_id || sub_path.last.s_id < m_sequential_view.current.first) continue; Color color;