Skip to content

Commit

Permalink
SPE-2369: Fixed crash when selecting Color Print view in preview (#12881
Browse files Browse the repository at this point in the history
)
  • Loading branch information
enricoturri1966 authored and lukasmatena committed Jun 24, 2024
1 parent 529a6fc commit 34346c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/slic3r/GUI/GCodeViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 34346c9

Please sign in to comment.