mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
#5236 - Fixed color not correctly shown after slice
The bug was introduced with 148f4fe766
which is now replaced by this commit
This commit is contained in:
parent
95d65f9f30
commit
92953acc57
2 changed files with 6 additions and 7 deletions
|
@ -598,9 +598,6 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure at least one (default) color is defined
|
|
||||||
std::string default_color = "#FF8000";
|
|
||||||
m_result.extruder_colors = std::vector<std::string>(1, default_color);
|
|
||||||
const ConfigOptionStrings* extruder_colour = config.option<ConfigOptionStrings>("extruder_colour");
|
const ConfigOptionStrings* extruder_colour = config.option<ConfigOptionStrings>("extruder_colour");
|
||||||
if (extruder_colour != nullptr) {
|
if (extruder_colour != nullptr) {
|
||||||
// takes colors from config
|
// takes colors from config
|
||||||
|
@ -615,7 +612,9 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// replace missing values with default
|
// replace missing values with default
|
||||||
|
std::string default_color = "#FF8000";
|
||||||
for (size_t i = 0; i < m_result.extruder_colors.size(); ++i) {
|
for (size_t i = 0; i < m_result.extruder_colors.size(); ++i) {
|
||||||
if (m_result.extruder_colors[i].empty())
|
if (m_result.extruder_colors[i].empty())
|
||||||
m_result.extruder_colors[i] = default_color;
|
m_result.extruder_colors[i] = default_color;
|
||||||
|
@ -837,10 +836,6 @@ void GCodeProcessor::process_file(const std::string& filename, bool apply_postpr
|
||||||
|
|
||||||
update_estimated_times_stats();
|
update_estimated_times_stats();
|
||||||
|
|
||||||
// ensure at least one (default) color is defined
|
|
||||||
if (m_result.extruder_colors.empty())
|
|
||||||
m_result.extruder_colors.push_back("#FF8000");
|
|
||||||
|
|
||||||
// post-process to add M73 lines into the gcode
|
// post-process to add M73 lines into the gcode
|
||||||
if (apply_postprocess)
|
if (apply_postprocess)
|
||||||
m_time_processor.post_process(filename);
|
m_time_processor.post_process(filename);
|
||||||
|
|
|
@ -373,6 +373,10 @@ void GCodeViewer::refresh(const GCodeProcessor::Result& gcode_result, const std:
|
||||||
// update tool colors
|
// update tool colors
|
||||||
m_tool_colors = decode_colors(str_tool_colors);
|
m_tool_colors = decode_colors(str_tool_colors);
|
||||||
|
|
||||||
|
// ensure at least one (default) color is defined
|
||||||
|
if (m_tool_colors.empty())
|
||||||
|
m_tool_colors.push_back(decode_color("#FF8000"));
|
||||||
|
|
||||||
// update ranges for coloring / legend
|
// update ranges for coloring / legend
|
||||||
m_extrusions.reset_ranges();
|
m_extrusions.reset_ranges();
|
||||||
for (size_t i = 0; i < m_moves_count; ++i) {
|
for (size_t i = 0; i < m_moves_count; ++i) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue