diff --git a/MatterControlLib/DesignTools/EditorTools/RotateControls/PathControl.cs b/MatterControlLib/DesignTools/EditorTools/RotateControls/PathControl.cs index a77abc0f9..2103cb318 100644 --- a/MatterControlLib/DesignTools/EditorTools/RotateControls/PathControl.cs +++ b/MatterControlLib/DesignTools/EditorTools/RotateControls/PathControl.cs @@ -37,7 +37,9 @@ using MatterHackers.DataConverters3D; using MatterHackers.MatterControl; using MatterHackers.MatterControl.DesignTools; using MatterHackers.MeshVisualizer; +using MatterHackers.PolygonMesh; using MatterHackers.RayTracer; +using MatterHackers.RenderOpenGl; using MatterHackers.RenderOpenGl.OpenGl; using MatterHackers.VectorMath; @@ -57,6 +59,7 @@ namespace MatterHackers.Plugins.EditorTools private bool controlsRegistered = false; private IEnumerable activePoints; + private Stroke sourceStroke; private bool m_visible; public PathControl(IInteractionVolumeContext context) @@ -94,37 +97,11 @@ namespace MatterHackers.Plugins.EditorTools public void DrawGlContent(DrawGlContentEventArgs e) { - GL.Begin(BeginMode.Lines); + if (sourceStroke != null + && e.Graphics2D is Graphics2DOpenGL glGraphics) { - GL.Color4(theme.PrimaryAccentColor); - - bool isStart = true; - - Vector3 last = Vector3.Zero; - Vector3 first = Vector3.Zero; - - foreach (var point in activePoints) - { - if (isStart - || point.IsMoveTo) - { - last = new Vector3(point.position); - first = last; - isStart = false; - } - else if (point.IsVertex) - { - GL.Vertex3(last); - GL.Vertex3(last = new Vector3(point.position)); - } - else if (point.IsClose) - { - GL.Vertex3(last); - GL.Vertex3(first); - } - } + glGraphics.RenderTransformedPath(Matrix4X4.Identity, sourceStroke, theme.PrimaryAccentColor, false); } - GL.End(); } public void LostFocus() @@ -159,6 +136,8 @@ namespace MatterHackers.Plugins.EditorTools activePoints = vertexStorage.Vertices(); + sourceStroke = new Stroke(new FlattenCurves(vertexStorage), 2); + VertexPointWidget widget = null; for (var i = 0; i < vertexStorage.Count; i++) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index af3ec83f2..48cf4a363 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit af3ec83f2db6d574d71f8d638d9e48aadf8257ff +Subproject commit 48cf4a363b490588c702d8c7ee9ffbfe97f67b04