mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-13 20:21:49 +08:00
Another follow-up of 8ebb2e2a290ea2bbbcd4d1bd119059a6211f4cd9 -> GCodeViewer: Ensure that the view is properly updated after automatic selection of view type introduced with 06e2835f8344cbcae88c6534fa7156689376d511
This commit is contained in:
parent
ca67d880ec
commit
4a9602b073
@ -910,6 +910,7 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
|||||||
|
|
||||||
GCodeViewer::EViewType gcode_view_type = m_canvas->get_gcode_view_preview_type();
|
GCodeViewer::EViewType gcode_view_type = m_canvas->get_gcode_view_preview_type();
|
||||||
bool gcode_preview_data_valid = !m_gcode_result->moves.empty();
|
bool gcode_preview_data_valid = !m_gcode_result->moves.empty();
|
||||||
|
|
||||||
// Collect colors per extruder.
|
// Collect colors per extruder.
|
||||||
std::vector<std::string> colors;
|
std::vector<std::string> colors;
|
||||||
std::vector<CustomGCode::Item> color_print_values = {};
|
std::vector<CustomGCode::Item> color_print_values = {};
|
||||||
@ -963,9 +964,8 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
|||||||
update_layers_slider(zs, keep_z_range);
|
update_layers_slider(zs, keep_z_range);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int number_extruders = (unsigned int)print->extruders().size();
|
|
||||||
|
|
||||||
if (!m_keep_current_preview_type) {
|
if (!m_keep_current_preview_type) {
|
||||||
|
unsigned int number_extruders = (unsigned int)print->extruders().size();
|
||||||
#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||||
std::vector<Item> gcodes = wxGetApp().is_editor() ?
|
std::vector<Item> gcodes = wxGetApp().is_editor() ?
|
||||||
wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes :
|
wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes :
|
||||||
@ -984,6 +984,12 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
|||||||
if (0 <= type && type < static_cast<int>(GCodeViewer::EViewType::Count)) {
|
if (0 <= type && type < static_cast<int>(GCodeViewer::EViewType::Count)) {
|
||||||
m_choice_view_type->SetSelection(type);
|
m_choice_view_type->SetSelection(type);
|
||||||
m_canvas->set_gcode_view_preview_type(static_cast<GCodeViewer::EViewType>(type));
|
m_canvas->set_gcode_view_preview_type(static_cast<GCodeViewer::EViewType>(type));
|
||||||
|
#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||||
|
if (wxGetApp().is_gcode_viewer()) {
|
||||||
|
m_keep_current_preview_type = true;
|
||||||
|
refresh_print();
|
||||||
|
}
|
||||||
|
#endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user