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/CenterLinePrimitive.cs')
-rw-r--r--UVtools.Core/Gerber/Primitives/CenterLinePrimitive.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/UVtools.Core/Gerber/Primitives/CenterLinePrimitive.cs b/UVtools.Core/Gerber/Primitives/CenterLinePrimitive.cs
index 5ac51fd..6e6d751 100644
--- a/UVtools.Core/Gerber/Primitives/CenterLinePrimitive.cs
+++ b/UVtools.Core/Gerber/Primitives/CenterLinePrimitive.cs
@@ -6,7 +6,6 @@
* of this license document, but changing it is not allowed.
*/
-using System;
using System.Data;
using System.Drawing;
using System.Text.RegularExpressions;
@@ -104,7 +103,7 @@ public class CenterLinePrimitive : Primitive
//CvInvoke.Rectangle(mat, rectangle, color, -1, lineType);
}
- public override void ParseExpressions(params string[] args)
+ public override void ParseExpressions(GerberDocument document, params string[] args)
{
string csharpExp, result;
float num;
@@ -126,6 +125,7 @@ public class CenterLinePrimitive : Primitive
result = exp.Compute(csharpExp, null).ToString()!;
if (float.TryParse(result, out var val)) Width = val;
}
+ Width = document.GetMillimeters(Width);
if (float.TryParse(HeightExpression, out num)) Height = num;
else
@@ -135,6 +135,7 @@ public class CenterLinePrimitive : Primitive
result = exp.Compute(csharpExp, null).ToString()!;
if (float.TryParse(result, out var val)) Height = val;
}
+ Height = document.GetMillimeters(Height);
if (float.TryParse(CenterXExpression, out num)) CenterX = num;
else
@@ -144,6 +145,7 @@ public class CenterLinePrimitive : Primitive
result = exp.Compute(csharpExp, null).ToString()!;
if (float.TryParse(result, out num)) CenterX = num;
}
+ CenterX = document.GetMillimeters(CenterX);
if (float.TryParse(CenterYExpression, out num)) CenterY = num;
else
@@ -153,6 +155,7 @@ public class CenterLinePrimitive : Primitive
result = exp.Compute(csharpExp, null).ToString()!;
if (float.TryParse(result, out num)) CenterY = num;
}
+ CenterY = document.GetMillimeters(CenterY);
if (float.TryParse(RotationExpression, out num)) Rotation = (short)num;
else