Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'UVtools.Core/Gerber/Primitives/OutlinePrimitive.cs')
-rw-r--r--UVtools.Core/Gerber/Primitives/OutlinePrimitive.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/UVtools.Core/Gerber/Primitives/OutlinePrimitive.cs b/UVtools.Core/Gerber/Primitives/OutlinePrimitive.cs
index 93a505a..80ecfaf 100644
--- a/UVtools.Core/Gerber/Primitives/OutlinePrimitive.cs
+++ b/UVtools.Core/Gerber/Primitives/OutlinePrimitive.cs
@@ -10,6 +10,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
+using System.Linq;
using System.Text.RegularExpressions;
using Emgu.CV;
using Emgu.CV.CvEnum;
@@ -94,7 +95,7 @@ public class OutlinePrimitive : Primitive
CvInvoke.FillPoly(mat, vec, color, lineType);
}
- public override void ParseExpressions(params string[] args)
+ public override void ParseExpressions(GerberDocument document, params string[] args)
{
string csharpExp, result;
float num;
@@ -125,7 +126,7 @@ public class OutlinePrimitive : Primitive
}
else
{
- coordinates.Add(new PointF(x.Value, num));
+ coordinates.Add(document.GetMillimeters(new PointF(x.Value, num)));
x = null;
}
}
@@ -143,4 +144,12 @@ public class OutlinePrimitive : Primitive
IsParsed = true;
}
+
+ public override Primitive Clone()
+ {
+ var primitive = MemberwiseClone() as OutlinePrimitive;
+ primitive!.CoordinatesExpression = primitive.CoordinatesExpression.ToArray();
+ primitive.Coordinates = primitive.Coordinates.ToArray();
+ return primitive;
+ }
} \ No newline at end of file