From 2afdc66dfb84f512a3f72b0a18ceb51873d779c5 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 6 Oct 2021 15:29:39 +0200 Subject: [PATCH] #7068 - Automatic update of legend when switching on/off travel visibility in preview --- src/slic3r/GUI/GUI_Preview.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index a67694541..0cd0ac9eb 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -496,13 +496,20 @@ void Preview::on_combochecklist_features(wxCommandEvent& evt) void Preview::on_combochecklist_options(wxCommandEvent& evt) { - unsigned int curr_flags = m_canvas->get_gcode_options_visibility_flags(); - unsigned int new_flags = Slic3r::GUI::combochecklist_get_flags(m_combochecklist_options); + const unsigned int curr_flags = m_canvas->get_gcode_options_visibility_flags(); + const unsigned int new_flags = Slic3r::GUI::combochecklist_get_flags(m_combochecklist_options); if (curr_flags == new_flags) return; m_canvas->set_gcode_options_visibility_from_flags(new_flags); - m_canvas->refresh_gcode_preview_render_paths(); + if (m_canvas->get_gcode_view_type() == GCodeViewer::EViewType::Feedrate) { + const unsigned int diff_flags = curr_flags ^ new_flags; + if ((diff_flags & (1 << static_cast(Preview::OptionType::Travel))) != 0) + refresh_print(); + } + else + m_canvas->refresh_gcode_preview_render_paths(); + update_moves_slider(); }