|
@@ -178,6 +178,9 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
{
|
|
|
var pathlist = shapeTypeCustom.GetFirstChild<PathList>();
|
|
|
var path = pathlist.GetFirstChild<DocumentFormat.OpenXml.Drawing.Path>();
|
|
|
+ var Width = shape.style.position.cx/path.Width.Value / 96.0 * 914400 ;
|
|
|
+ var Height = shape.style.position.cy/ path.Height.Value / 96.0 * 914400;
|
|
|
+
|
|
|
var pathChildren = path.ChildElements;
|
|
|
if (pathChildren != null)
|
|
|
{
|
|
@@ -188,8 +191,8 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (start != null)
|
|
|
{
|
|
|
var point = start.GetFirstChild<DocumentFormat.OpenXml.Drawing.Point>();
|
|
|
- spX = System.Math.Round(double.Parse(point.X.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
- spY = System.Math.Round(double.Parse(point.Y.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
+ spX = double.Parse(point.X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ spY = double.Parse(point.Y.Value) * Globals.px96 / Globals.px914400* Height;
|
|
|
}
|
|
|
var d = "M" + spX + "," + spY;
|
|
|
foreach (var child in pathChildren)
|
|
@@ -199,21 +202,21 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
var elm = lineTo.GetFirstChild<DocumentFormat.OpenXml.Drawing.Point>();
|
|
|
if (elm != null)
|
|
|
{
|
|
|
- var Lx = System.Math.Round(double.Parse(elm.X.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
- var Ly = System.Math.Round(double.Parse(elm.Y.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
+ var Lx = double.Parse(elm.X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Ly = double.Parse(elm.Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
d += " L" + Lx + "," + Ly;
|
|
|
}
|
|
|
}
|
|
|
if (child is ArcTo arcTo)
|
|
|
{
|
|
|
- var WidthRadius = arcTo.WidthRadius;
|
|
|
- var HeightRadius = arcTo.HeightRadius;
|
|
|
+ var WidthRadius = arcTo.WidthRadius ;
|
|
|
+ var HeightRadius = arcTo.HeightRadius ;
|
|
|
var StartAngle = arcTo.StartAngle;
|
|
|
var SwingAngle = arcTo.SwingAngle;
|
|
|
- var wR = System.Math.Round(double.Parse(WidthRadius.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
- var hR = System.Math.Round(double.Parse(HeightRadius.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
- var stAng = System.Math.Round(double.Parse(StartAngle.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
- var swAng = System.Math.Round(double.Parse(SwingAngle.Value) * Globals.px96 * 1.0 / Globals.px914400, Globals.degree);
|
|
|
+ var wR = double.Parse(WidthRadius.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var hR = double.Parse(HeightRadius.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
+ var stAng = double.Parse(StartAngle.Value) * Globals.px96 / Globals.px914400;
|
|
|
+ var swAng = double.Parse(SwingAngle.Value) * Globals.px96 / Globals.px914400;
|
|
|
var endAng = stAng + swAng;
|
|
|
d += SvgHelper.ShapeArc(wR, hR, wR, hR, stAng, endAng, false);
|
|
|
}
|
|
@@ -223,15 +226,15 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (elms != null)
|
|
|
{
|
|
|
var list = elms.ToList();
|
|
|
- var Cx1 = double.Parse(list[0].X.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- var Cy1 = double.Parse(list[0].Y.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
+ var Cx1 = double.Parse(list[0].X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Cy1 = double.Parse(list[0].Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
|
|
|
- var Cx2 = double.Parse(list[1].X.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- var Cy2 = double.Parse(list[1].Y.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
+ var Cx2 = double.Parse(list[1].X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Cy2 = double.Parse(list[1].Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
|
|
|
- var Cx3 = double.Parse(list[2].X.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- var Cy3 = double.Parse(list[2].Y.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- d += " C" + System.Math.Round(Cx1, Globals.degree) + "," + System.Math.Round(Cy1, Globals.degree) + " " + System.Math.Round(Cx2, Globals.degree) + "," + System.Math.Round(Cy2, Globals.degree) + " " + System.Math.Round(Cx3, Globals.degree) + "," + System.Math.Round(Cy3, Globals.degree);
|
|
|
+ var Cx3 = double.Parse(list[2].X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Cy3 = double.Parse(list[2].Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
+ d += " C" + Cx1 + "," + Cy1 + " " + Cx2 + "," + Cy2 + " " + Cx3 + "," + Cy3;
|
|
|
}
|
|
|
}
|
|
|
if (child is CubicBezierCurveTo cubicBezierCurveTo)
|
|
@@ -240,12 +243,15 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (elms != null)
|
|
|
{
|
|
|
var list = elms.ToList();
|
|
|
- var Cx1 = double.Parse(list[0].X.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- var Cy1 = double.Parse(list[0].Y.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
+ var Cx1 = double.Parse(list[0].X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Cy1 = double.Parse(list[0].Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
+
|
|
|
+ var Cx2 = double.Parse(list[1].X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Cy2 = double.Parse(list[1].Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
|
|
|
- var Cx2 = double.Parse(list[1].X.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- var Cy2 = double.Parse(list[1].Y.Value) * Globals.px96 * 1.0 / Globals.px914400;
|
|
|
- d += " Q" + System.Math.Round(Cx1, Globals.degree) + "," + System.Math.Round(Cy1, Globals.degree) + " " + System.Math.Round(Cx2, Globals.degree) + "," + System.Math.Round(Cy2, Globals.degree);
|
|
|
+ var Cx3 = double.Parse(list[2].X.Value) * Globals.px96 / Globals.px914400 * Width;
|
|
|
+ var Cy3 = double.Parse(list[2].Y.Value) * Globals.px96 / Globals.px914400 * Height;
|
|
|
+ d += " C" + Cx1 + "," + Cy1 + " " + Cx2 + "," + Cy2 + " " + Cx3 + "," + Cy3;
|
|
|
}
|
|
|
}
|
|
|
}
|