mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 19:25:59 +08:00
SPE-2369: Fixed crash when selecting Color Print view in preview (#12881)
This commit is contained in:
parent
529a6fc0ae
commit
34346c9126
@ -873,8 +873,8 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
|
||||
|
||||
// collect color print colors
|
||||
libvgcode::Palette color_print_colors;
|
||||
color_print_colors.reserve(str_color_print_colors.size());
|
||||
for (const std::string& color : str_color_print_colors) {
|
||||
const std::vector<std::string>& str_colors = str_color_print_colors.empty() ? str_tool_colors : str_color_print_colors;
|
||||
for (const std::string& color : str_colors) {
|
||||
color_print_colors.emplace_back(libvgcode::convert(color));
|
||||
}
|
||||
m_viewer.set_color_print_colors(color_print_colors);
|
||||
|
@ -745,8 +745,9 @@ GCodeInputData convert(const Slic3r::Print& print, const std::vector<std::string
|
||||
}
|
||||
|
||||
// collect color print colors
|
||||
ret.color_print_colors.reserve(str_color_print_colors.size());
|
||||
for (const std::string& color : str_color_print_colors) {
|
||||
const std::vector<std::string>& str_colors = str_color_print_colors.empty() ? str_tool_colors : str_color_print_colors;
|
||||
ret.color_print_colors.reserve(str_colors.size());
|
||||
for (const std::string& color : str_colors) {
|
||||
ret.color_print_colors.emplace_back(convert(color));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user