hack/Fix error when scrolling over a layer with feature selection: everything was filtered out.

(bad global_endpoints)
supermerill/SuperSlicer#1522
This commit is contained in:
supermerill 2021-09-26 15:17:28 +02:00
parent 088b92917c
commit d45c92c6fb

View File

@ -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;