more path work

This commit is contained in:
LarsBrubaker 2022-08-09 16:21:39 -07:00
parent 33ee6fe3fd
commit aadec8b9f5
4 changed files with 20 additions and 8 deletions

View file

@ -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(

View file

@ -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)

View file

@ -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();
}
}
}
}

@ -1 +1 @@
Subproject commit d9a37aa87794203eb741f0713a3dfe9210383393
Subproject commit 36ca84b13297ae1521c8493a09f35140834018fd