From cf013d5ab3f075bd001d1e4ef7858f256a844825 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 8 Oct 2020 12:47:38 +0200 Subject: [PATCH] Follow-up of 2ecd78b0d5d1259d3aafae272bea6f01352c7574 -> More robust fix --- src/slic3r/GUI/GCodeViewer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index ed26e0b79..4a40f06a5 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1689,8 +1689,6 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool break; } - unsigned int render_paths_count = 0; - // second pass: filter paths by sequential data and collect them by color for (const auto& [buffer, index_buffer_id, path_id] : paths) { const Path& path = buffer->paths[path_id]; @@ -1713,7 +1711,6 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool it->color = color; it->path_id = path_id; it->index_buffer_id = index_buffer_id; - ++render_paths_count; } unsigned int segments_count = std::min(m_sequential_view.current.last, path.last.s_id) - std::max(m_sequential_view.current.first, path.first.s_id) + 1; @@ -1736,7 +1733,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool it->offsets.push_back(static_cast((path.first.i_id + delta_1st) * sizeof(unsigned int))); } - wxGetApp().plater()->enable_preview_moves_slider(render_paths_count > 0); + wxGetApp().plater()->enable_preview_moves_slider(!paths.empty()); #if ENABLE_GCODE_VIEWER_STATISTICS for (const TBuffer& buffer : m_buffers) {