From ce5ad5f687b189beacd54c5b35c602dcbf50512d Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 4 May 2018 13:47:16 -0700 Subject: [PATCH] Updated animation callback Working on fixed string --- .../ApplicationSettingsView.cs | 2 +- DesignTools/Operations/Align3D.cs | 18 ++++++++++++++++++ DesignTools/Primitives/CubeObject3D.cs | 2 +- PartPreviewWindow/RoundedToggleSwitch.cs | 4 ++-- Submodules/agg-sharp | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 5f3fd42ea..0a164f1e3 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -320,7 +320,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage Padding = new BorderDouble(2), Border = new BorderDouble(1), BorderColor = theme.Colors.PrimaryAccentColor, - VAnchor = VAnchor.Center | VAnchor.Fit + VAnchor = VAnchor.Center | VAnchor.Fit, }; blueBox.AddChild(new TextWidget("64", pointSize: 8, textColor: theme.Colors.PrimaryAccentColor)); diff --git a/DesignTools/Operations/Align3D.cs b/DesignTools/Operations/Align3D.cs index 2c28cf1bf..3ffaab8bb 100644 --- a/DesignTools/Operations/Align3D.cs +++ b/DesignTools/Operations/Align3D.cs @@ -170,6 +170,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } } + [HideUpdateButtonAttribute] public class Align3D : Object3D, IRebuildable, IPropertyGridModifier { // We need to serialize this so we can remove the arrange and get back to the objects before arranging @@ -318,8 +319,19 @@ namespace MatterHackers.MatterControl.DesignTools.Operations return positionToAlignTo + extraOffset; } + bool inRebuild; + protected override void OnInvalidate() + { + if (!inRebuild) + { + Rebuild(null); + } + base.OnInvalidate(); + } + public void Rebuild(UndoBuffer undoBuffer) { + inRebuild = true; var aabb = this.GetAxisAlignedBoundingBox(); // TODO: check if the has code for the children @@ -337,6 +349,10 @@ namespace MatterHackers.MatterControl.DesignTools.Operations var currentChildrenBounds = CurrentChildrenBounds; this.Children.Modify(list => { + if(list.Count == 0) + { + return; + } var firstBounds = currentChildrenBounds[0]; int i = 0; foreach (var child in list) @@ -402,6 +418,8 @@ namespace MatterHackers.MatterControl.DesignTools.Operations i++; } }); + + inRebuild = false; } public override void Remove(UndoBuffer undoBuffer) diff --git a/DesignTools/Primitives/CubeObject3D.cs b/DesignTools/Primitives/CubeObject3D.cs index 0894b7560..3368f22cf 100644 --- a/DesignTools/Primitives/CubeObject3D.cs +++ b/DesignTools/Primitives/CubeObject3D.cs @@ -40,7 +40,7 @@ namespace MatterHackers.MatterControl.DesignTools { public CubeObject3D() { - Name = "Cylinder".Localize(); + Name = "Cube".Localize(); Color = ApplicationController.Instance.PrimitiveColors["Cube"]; } diff --git a/PartPreviewWindow/RoundedToggleSwitch.cs b/PartPreviewWindow/RoundedToggleSwitch.cs index c1589c890..1b374c743 100644 --- a/PartPreviewWindow/RoundedToggleSwitch.cs +++ b/PartPreviewWindow/RoundedToggleSwitch.cs @@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl.CustomWidgets internal double animationRatio = 0; internal double finalRadius = 22 * GuiWidget.DeviceScale; - public override void OnUpdate(double secondsThisUpdate) + public override bool OnUpdate(UpdateEvent updateEvent) { if (IsRunning) { @@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl.CustomWidgets Stop(); } - base.OnUpdate(secondsThisUpdate); + return base.OnUpdate(updateEvent); } } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 632bb7520..f19919b29 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 632bb7520408493d6043e0a57a8b60f8326bda0b +Subproject commit f19919b29f82e37f788267f458fdcc5e08309642