SPE-1814: Fixed legend not automatically switching to color print view when color change is set in layer height bar for mmu printers

This commit is contained in:
enricoturri1966 2024-02-06 14:32:08 +01:00 committed by Lukas Matena
parent 542397140a
commit f6027deca9

View File

@ -846,7 +846,7 @@ void Preview::load_print_as_fff(bool keep_z_range)
wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes :
m_canvas->get_custom_gcode_per_print_z();
const bool contains_color_gcodes = std::any_of(std::begin(gcodes), std::end(gcodes),
[] (auto const& item) { return item.type == CustomGCode::Type::ColorChange; });
[](auto const& item) { return item.type == CustomGCode::Type::ColorChange || item.type == CustomGCode::Type::ToolChange; });
const GCodeViewer::EViewType choice = contains_color_gcodes ?
GCodeViewer::EViewType::ColorPrint :
(number_extruders > 1) ? GCodeViewer::EViewType::Tool : GCodeViewer::EViewType::FeatureType;