From aadec8b9f5f9d19f7a2c48954d2b9bb2872232f4 Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Tue, 9 Aug 2022 16:21:39 -0700 Subject: [PATCH] more path work --- .../DesignTools/Operations/Object3DExtensions.cs | 11 +++++++++++ .../Operations/Path/InflatePathObject3D.cs | 10 ++++------ .../DesignTools/Primitives/TextObject3D.cs | 5 ++++- Submodules/agg-sharp | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs b/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs index 831fda8f9..41e05329b 100644 --- a/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs +++ b/MatterControlLib/DesignTools/Operations/Object3DExtensions.cs @@ -87,6 +87,17 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } } + public static void RefreshToolBar(this IObject3D item) + { + var sceneContext = item.ContainingScene(); + if (sceneContext != null) + { + // deselect than re-select the item + sceneContext.SelectedItem = null; + sceneContext.SelectedItem = item; + } + } + public static void ShowRenameDialog(this IObject3D item, UndoBuffer undoBuffer) { DialogWindow.Show( diff --git a/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs b/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs index ff09dd015..052a5975c 100644 --- a/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/Path/InflatePathObject3D.cs @@ -52,8 +52,6 @@ namespace MatterHackers.MatterControl.DesignTools.Operations public class InflatePathObject3D : Object3D, IEditorDraw, IObject3DControlsProvider { - public override IVertexSource VertexSource { get; set; } = new VertexStorage(); - public InflatePathObject3D() { Name = "Inflate Path".Localize(); @@ -101,7 +99,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations { InsetPath(); // set the mesh to show the path - this.Mesh = this.VertexSource.Extrude(Constants.PathPolygonsHeight); + this.Mesh = VertexStorage.Extrude(Constants.PathPolygonsHeight); } this.CancelAllParentBuilding(); @@ -111,15 +109,15 @@ namespace MatterHackers.MatterControl.DesignTools.Operations private void InsetPath() { - var path = this.Children.Where(c => c.VertexSource != null).FirstOrDefault(); + var path = this.CombinedVisibleChildrenPaths(); if (path == null) { // clear our existing data - VertexSource = new VertexStorage(); + VertexStorage = new VertexStorage(); return; } - VertexSource = path.VertexSource.Offset(Inflate.Value(this), GetJoinType(Style)); + VertexStorage = path.Offset(Inflate.Value(this), GetJoinType(Style)); } internal static JoinType GetJoinType(ExpandStyles style) diff --git a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs index 39b27269b..ca5ec9707 100644 --- a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs @@ -108,7 +108,6 @@ namespace MatterHackers.MatterControl.DesignTools public NamedTypeFace Font { get; set; } = NamedTypeFace.Nunito_Bold; [EnumDisplay(Mode = EnumDisplayAttribute.PresentationMode.Buttons)] - // [Icons(new string[] { "align_left.png", "align_center_x.png", "align_right.png" }, InvertIcons = true)] public OutputDimensions Output { get; set; } = OutputDimensions.Output3D; public override bool CanApply => true; @@ -315,6 +314,10 @@ namespace MatterHackers.MatterControl.DesignTools change.SetRowVisible(nameof(Alignment), () => MultiLine); change.SetRowVisible(nameof(NameToWrite), () => !MultiLine); change.SetRowVisible(nameof(Height), () => Output == OutputDimensions.Output3D); + if (change.Changed == nameof(Output)) + { + this.RefreshToolBar(); + } } } } \ No newline at end of file diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index d9a37aa87..36ca84b13 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit d9a37aa87794203eb741f0713a3dfe9210383393 +Subproject commit 36ca84b13297ae1521c8493a09f35140834018fd