Fix sidebar filament count for multi-extruder printers (#13706)

load_selections() and update_selections() size the parallel project_config
arrays (filament_colour, filament_colour_type, filament_map) off
filament_presets.size(). When the saved list is shorter than the printer's
nozzle count — never-used printer, hand-trimmed conf, or fewer filament_NN
entries than nozzles — the loaded colors get truncated and the sidebar
starts up one combo short.
This commit is contained in:
SoftFever
2026-05-18 01:18:09 +08:00
committed by GitHub
parent bcbc581417
commit 484ce81e38
2 changed files with 23 additions and 0 deletions
+6
View File
@@ -372,6 +372,12 @@ public:
int get_printer_extruder_count() const;
bool support_different_extruders();
// Orca: Ensure filament_presets has at least one slot per nozzle on FFF printers.
// Called from (load|update)_selections before the parallel project_config arrays
// (filament_colour/colour_type/map) are sized off filament_presets.size(), so a
// short saved filament list doesn't truncate the loaded colors.
void update_filament_count();
// Load user configuration and store it into the user profiles.
// This method is called by the configuration wizard.
void load_config_from_wizard(const std::string &name, DynamicPrintConfig config, Semver file_version)