diff --git a/MatterControlLib/DesignTools/PublicPropertyEditor.cs b/MatterControlLib/DesignTools/PublicPropertyEditor.cs index 14b3097ca..9e7bea017 100644 --- a/MatterControlLib/DesignTools/PublicPropertyEditor.cs +++ b/MatterControlLib/DesignTools/PublicPropertyEditor.cs @@ -857,17 +857,6 @@ namespace MatterHackers.MatterControl.DesignTools }; field.Initialize(0); field.SetValue(doubleExpresion.Expression, false); - void EnsureFormating(double value) - { - var format = "0." + new string('#', 5); - if (property.PropertyInfo.GetCustomAttributes(true).OfType().FirstOrDefault() is MaxDecimalPlacesAttribute decimalPlaces) - { - format = "0." + new string('#', Math.Min(10, decimalPlaces.Number)); - } - - field.TextValue = value.ToString(format); - } - EnsureFormating(doubleExpresion.Value(object3D)); field.ClearUndoHistory(); RegisterValueChanged(field, (valueString) => new DoubleOrExpression(valueString), @@ -880,12 +869,27 @@ namespace MatterHackers.MatterControl.DesignTools void RefreshField(object s, InvalidateArgs e) { + // This code only executes when the in scene controls are updating the objects data and the display needs to tack them. if (e.InvalidateType.HasFlag(InvalidateType.DisplayValues)) { DoubleOrExpression newValue = (DoubleOrExpression)property.Value; if (newValue.Expression != field.Value) { - EnsureFormating(newValue.Value(object3D)); + // we should never be in the situation where there is an '=' as the in scene controls should be disabled + if (newValue.Expression.StartsWith("=")) + { + field.TextValue = newValue.Expression; + } + else + { + var format = "0." + new string('#', 5); + if (property.PropertyInfo.GetCustomAttributes(true).OfType().FirstOrDefault() is MaxDecimalPlacesAttribute decimalPlaces) + { + format = "0." + new string('#', Math.Min(10, decimalPlaces.Number)); + } + + field.TextValue = newValue.Value(object3D).ToString(format); + } } } } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index c4d395b08..7cf400f33 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit c4d395b08e2185e20f72990354aa133fc73eacdf +Subproject commit 7cf400f33c8a740b09bd78575abef7679f8bb060