From 3bcb36eaab92cee8d5fec9f69846334df6b12fd4 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 1 Jul 2022 17:39:11 -0700 Subject: [PATCH] Restore source objects when canceled --- .../View3D/Actions/CombineObject3D_2.cs | 16 ++++++++++++++++ Submodules/agg-sharp | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs b/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs index 4b6bb2905..7df4d37bb 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs @@ -129,6 +129,22 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D try { Combine(cancellationTokenSource.Token, reporter); + + if (cancellationToken.IsCancellationRequested) + { + // the combine was canceled set our children to the source object children + SourceContainer.Visible = true; + RemoveAllButSource(); + Children.Modify((list) => + { + foreach (var child in SourceContainer.Children) + { + list.Add(child); + } + }); + + SourceContainer.Visible = false; + } } catch { diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 1d16b11a1..4ecb3ed94 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 1d16b11a1d3eb375996808be4ae174e98600edf6 +Subproject commit 4ecb3ed94a016319fb137e9f6b938c12bc7d6703