diff --git a/MatterControlLib/SlicerConfiguration/Settings/PrinterSettings.cs b/MatterControlLib/SlicerConfiguration/Settings/PrinterSettings.cs index ce26f5a0e..31b3e783f 100644 --- a/MatterControlLib/SlicerConfiguration/Settings/PrinterSettings.cs +++ b/MatterControlLib/SlicerConfiguration/Settings/PrinterSettings.cs @@ -339,37 +339,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } internal set { - SetMaterialPreset(0, value); + if (MaterialSettingsKeys.Count == 0 || value != MaterialSettingsKeys[0]) + { + MaterialSettingsKeys.Clear(); + MaterialSettingsKeys.Add(value); + MaterialLayer = GetMaterialLayer(value); + this.OnMaterialPresetChanged(); + + Save(); + } } } - private void SetMaterialPreset(int extruderIndex, string materialKey) - { - if (extruderIndex >= PrinterCommunication.PrinterConnection.MAX_EXTRUDERS) - { - throw new ArgumentOutOfRangeException("Requested extruder index is outside of bounds: " + extruderIndex); - } - - // TODO: This should really be in PrinterProfile and should be run when the extruder count changes - if (MaterialSettingsKeys.Count <= extruderIndex) - { - var resizedArray = new string[extruderIndex + 1]; - MaterialSettingsKeys.CopyTo(resizedArray); - MaterialSettingsKeys = new List(resizedArray); - } - - MaterialSettingsKeys[extruderIndex] = materialKey; - - if (extruderIndex == 0) - { - MaterialLayer = GetMaterialLayer(materialKey); - - this.OnMaterialPresetChanged(); - } - - Save(); - } - public List MaterialSettingsKeys { get; set; } = new List(); [JsonIgnore] diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index 4be375686..c7442baf6 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit 4be37568691a3913b3ce077405ee9efa0f20f680 +Subproject commit c7442baf66d96135440e11a27070fd90fbb56db5 diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index eb71dfbdb..16a8ca59a 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit eb71dfbdb9e22dc9603efe3fa551cc2a8bec8119 +Subproject commit 16a8ca59abf20d4a07e829a1163130adfd58b0a8