From d45c92c6fb8730987c89abab4a653538b892a016 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sun, 26 Sep 2021 15:17:28 +0200 Subject: [PATCH] hack/Fix error when scrolling over a layer with feature selection: everything was filtered out. (bad global_endpoints) supermerill/SuperSlicer#1522 --- src/slic3r/GUI/GCodeViewer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index f020e739a..2ed59a435 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2956,6 +2956,12 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool } } + //fix error (all paths in m_buffers may be out of the m_layers_z_range) + //FIXME better than this dumb stop-gap + if (global_endpoints.first > global_endpoints.last) { + global_endpoints = { 0, m_moves_count }; + } + // update current sequential position sequential_view->current.first = !top_layer_only && keep_sequential_current_first ? std::clamp(sequential_view->current.first, global_endpoints.first, global_endpoints.last) : global_endpoints.first; sequential_view->current.last = keep_sequential_current_last ? std::clamp(sequential_view->current.last, global_endpoints.first, global_endpoints.last) : global_endpoints.last;