diff options
Diffstat (limited to 'UVtools.Core/Operations/OperationLayerRemove.cs')
-rw-r--r-- | UVtools.Core/Operations/OperationLayerRemove.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/UVtools.Core/Operations/OperationLayerRemove.cs b/UVtools.Core/Operations/OperationLayerRemove.cs index 406a24f..b815c7f 100644 --- a/UVtools.Core/Operations/OperationLayerRemove.cs +++ b/UVtools.Core/Operations/OperationLayerRemove.cs @@ -73,9 +73,17 @@ namespace UVtools.Core.Operations progress ??= new OperationProgress(false); - progress.Reset("removed layers", (uint)layersRemove.Count); + progress.Reset("Removed layers", (uint)layersRemove.Count); - var oldLayers = slicerFile.LayerManager.Layers; + foreach (var layerIndex in layersRemove) + { + slicerFile[layerIndex] = null; + progress++; + } + + slicerFile.LayerManager.RemoveNulls(); + + /*var oldLayers = slicerFile.LayerManager.Layers; var layerHeight = slicerFile.LayerHeight; var layers = new Layer[oldLayers.Length - layersRemove.Count]; @@ -109,7 +117,9 @@ namespace UVtools.Core.Operations progress++; } - slicerFile.LayerManager.Layers = layers; + slicerFile.LayerManager.Layers = layers;*/ + + return true; } |