From 8cc089322256e49f56f07668b3ae29ef593085e5 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 15 Nov 2023 14:40:05 -0800 Subject: [PATCH] Improving line positions --- .../DesignTools/Operations/RadialPinchObject3D.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MatterControlLib/DesignTools/Operations/RadialPinchObject3D.cs b/MatterControlLib/DesignTools/Operations/RadialPinchObject3D.cs index 147d1a76c..d42893643 100644 --- a/MatterControlLib/DesignTools/Operations/RadialPinchObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/RadialPinchObject3D.cs @@ -40,6 +40,7 @@ using MatterHackers.PolygonMesh; using MatterHackers.RenderOpenGl; using MatterHackers.RenderOpenGl.OpenGl; using MatterHackers.VectorMath; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -298,10 +299,13 @@ namespace MatterHackers.MatterControl.DesignTools graphics2D.Line(pathEditorWidget.TotalTransform.Transform(leftOrigin), pathEditorWidget.TotalTransform.Transform(rightOrigin), lineColor); graphics2D.DrawString(bounds.ZSize.ToString("0.##"), pathEditorWidget.TotalTransform.Transform(new Vector2(0, bounds.ZSize)) + new Vector2(2, 2), 9, color: lineColor.WithAlpha(150)); - var bottomOrigin = new Vector2(bounds.XSize / 2, -10000); - var topOrigin = new Vector2(bounds.XSize / 2, 10000); + var maxWidthDepth = Math.Max(bounds.XSize / 2 + RotationOffset.X, bounds.YSize / 2 + RotationOffset.Y); + + var bottomOrigin = new Vector2(maxWidthDepth, -10000); + var topOrigin = new Vector2(maxWidthDepth, 10000); + graphics2D.Line(pathEditorWidget.TotalTransform.Transform(bottomOrigin), pathEditorWidget.TotalTransform.Transform(topOrigin), lineColor); - graphics2D.DrawString((bounds.XSize / 2).ToString("0.##"), pathEditorWidget.TotalTransform.Transform(new Vector2(bounds.XSize / 2, 0)) + new Vector2(2, 2), 9, color: lineColor.WithAlpha(150)); + graphics2D.DrawString(maxWidthDepth.ToString("0.##"), pathEditorWidget.TotalTransform.Transform(new Vector2(maxWidthDepth, 0)) + new Vector2(2, 2), 9, color: lineColor.WithAlpha(150)); } }