|
@@ -20,8 +20,8 @@ namespace HTEXLib.Helpers
|
|
|
public static Svg GenShapeSvg(OpenXmlElement node, string shapeType, Position position, Border shapeBorder) {
|
|
|
int? isFlipV = position.flipV;
|
|
|
string shapType = shapeType;
|
|
|
- double w = System.Math.Round(position.cy, degree);
|
|
|
- double h = System.Math.Round(position.cx, degree); ;
|
|
|
+ double w = System.Math.Round(position.cx, degree);
|
|
|
+ double h = System.Math.Round(position.cy, degree); ;
|
|
|
GenShapeDelegate genShapeDelegate;
|
|
|
Svg resultSvg = null;
|
|
|
Border border = shapeBorder;
|
|
@@ -929,7 +929,7 @@ namespace HTEXLib.Helpers
|
|
|
|
|
|
}
|
|
|
var shapAdjst_val = 0.5;
|
|
|
- string points;
|
|
|
+ string points="M";
|
|
|
// string MarkerStart = "";
|
|
|
// string MarkerEnd = "";
|
|
|
if (shapAdjst != null)
|
|
@@ -937,31 +937,32 @@ namespace HTEXLib.Helpers
|
|
|
shapAdjst_val = double.Parse(shapAdjst.Value.Substring(4)) * 1.0 / 100000;
|
|
|
if (isFlipV == 1)
|
|
|
{
|
|
|
- points = w + " 0," + ((1 - shapAdjst_val) * w) + " 0," + ((1 - shapAdjst_val) * w) + " " + h + ",0 " + h;
|
|
|
+ points = w + " 0,L" + ((1 - shapAdjst_val) * w) + " 0,L" + ((1 - shapAdjst_val) * w) + " " + h + ",L0 " + h;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- points = "0 0," + (shapAdjst_val) * w + " 0," + (shapAdjst_val) * w + " " + h + "," + w + " " + h;
|
|
|
+ points = "0 0,L" + (shapAdjst_val) * w + " 0,L" + (shapAdjst_val) * w + " " + h + ",L" + w + " " + h;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (isFlipV == 1)
|
|
|
{
|
|
|
- points = w + " 0," + ((1 - shapAdjst_val) * w) + " 0," + ((1 - shapAdjst_val) * w) + " " + h + ",0 " + h;
|
|
|
+ points = w + " 0,L" + ((1 - shapAdjst_val) * w) + " 0,L" + ((1 - shapAdjst_val) * w) + " " + h + ",L0 " + h;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- points = "0 0," + (shapAdjst_val) * w + " 0," + (shapAdjst_val) * w + " " + h + "," + w + " " + h;
|
|
|
+ points = "0 0,L" + (shapAdjst_val) * w + " 0,L" + (shapAdjst_val) * w + " " + h + ",L" + w + " " + h;
|
|
|
}
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polyline {
|
|
|
- type = "polyline",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
//Fill = "transparent",
|
|
|
// Stroke = "#" + border.Color,
|
|
|
// StrokeWidth = border.Width ,
|
|
|
// StrokeDasharray = border.Stroke,
|
|
|
- points=points,
|
|
|
+ //points=points,
|
|
|
+ d=points,
|
|
|
start=border.headEnd,
|
|
|
end=border.tailEnd,
|
|
|
} };
|
|
@@ -997,12 +998,12 @@ namespace HTEXLib.Helpers
|
|
|
|
|
|
}
|
|
|
double adj2 = (1 - adj1);
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points= adj1 * w + " 0," + adj1 * w + " " + adj1 * h + ",0 " + adj1 * h + ",0 " + adj2 * h + "," +
|
|
|
- adj1 * w + " " + adj2 * h + "," + adj1 * w + " " + h + "," + adj2 * w + " " + h + "," + adj2 * w + " " + adj2 * h + "," + w + " " + adj2 * h + "," +
|
|
|
- +w + " " + adj1 * h + "," + adj2 * w + " " + adj1 * h + "," + adj2 * w + " 0",
|
|
|
+ d= "M"+adj1 * w + " 0,L" + adj1 * w + " " + adj1 * h + ",L0 " + adj1 * h + ",L0 " + adj2 * h + ",L" +
|
|
|
+ adj1 * w + " " + adj2 * h + ",L" + adj1 * w + " " + h + ",L" + adj2 * w + " " + h + ",L" + adj2 * w + " " + adj2 * h + ",L" + w + " " + adj2 * h + ",L" +
|
|
|
+ +w + " " + adj1 * h + ",L" + adj2 * w + " " + adj1 * h + ",L" + adj2 * w + " 0 z",
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -3387,16 +3388,25 @@ namespace HTEXLib.Helpers
|
|
|
Y1 = 0;
|
|
|
Y2 = h;
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Line {
|
|
|
- type = "line",
|
|
|
+ //List<SvgShape> shapes = new List<SvgShape>() {new Line {
|
|
|
+ // type = "line",
|
|
|
+ // start=border.headEnd,
|
|
|
+ // end=border.tailEnd,
|
|
|
+ // x1=X1,
|
|
|
+ // x2=X2,
|
|
|
+ // y1=Y1,
|
|
|
+ // y2=Y2
|
|
|
+ //} };
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
start=border.headEnd,
|
|
|
end=border.tailEnd,
|
|
|
- x1=X1,
|
|
|
- x2=X2,
|
|
|
- y1=Y1,
|
|
|
- y2=Y2
|
|
|
+ d="M"+X1+" "+Y1+",L"+X2+" "+ Y2,
|
|
|
+ //x1=X1,
|
|
|
+ //x2=X2,
|
|
|
+ //y1=Y1,
|
|
|
+ //y2=Y2
|
|
|
} };
|
|
|
-
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -3530,11 +3540,11 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points= w + " " + h * 1.0 / 2 + "," + sAdj2_val * w + " 0," + sAdj2_val * w + " " + sAdj1_val * h + ",0 " + sAdj1_val * h +
|
|
|
- ",0 " + (1 - sAdj1_val) * h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + ", " + sAdj2_val * w + " " + h ,
|
|
|
+ d="M"+ w + " " + h * 1.0 / 2 + ",L" + sAdj2_val * w + " 0,L" + sAdj2_val * w + " " + sAdj1_val * h + ",L0 " + sAdj1_val * h +
|
|
|
+ ",L0 " + (1 - sAdj1_val) * h + ",L" + sAdj2_val * w + " " + (1 - sAdj1_val) * h + ",L" + sAdj2_val * w + " " + h+" z" ,
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -3579,11 +3589,10 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
-
|
|
|
- points= "0 " + h * 1.0 / 2 + "," + sAdj2_val * w + " " + h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + "," + w + " " + (1 - sAdj1_val) * h +
|
|
|
- "," + w + " " + sAdj1_val * h + "," + sAdj2_val * w + " " + sAdj1_val * h + ", " + sAdj2_val * w + " 0",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d= "M0 " + h * 1.0 / 2 + ",L" + sAdj2_val * w + " " + h + ",L" + sAdj2_val * w + " " + (1 - sAdj1_val) * h + ",L" + w + " " + (1 - sAdj1_val) * h +
|
|
|
+ ",L" + w + " " + sAdj1_val * h + ",L" + sAdj2_val * w + " " + sAdj1_val * h + ",L" + sAdj2_val * w + " 0 z",
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -3632,11 +3641,11 @@ namespace HTEXLib.Helpers
|
|
|
sAdj2_val = 0.212;
|
|
|
}
|
|
|
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points= (0.5 - sAdj1_val) * w + " 0," + (0.5 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ",0 " + (1 - sAdj2_val) * h + "," + (w * 1.0 / 2) + " " + h +
|
|
|
- "," + w + " " + (1 - sAdj2_val) * h + "," + (0.5 + sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ", " + (0.5 + sAdj1_val) * w + " 0",
|
|
|
+ d= "M"+(0.5 - sAdj1_val) * w + " 0,L" + (0.5 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ",L0 " + (1 - sAdj2_val) * h + ",L" + (w * 1.0 / 2) + " " + h +
|
|
|
+ ",L" + w + " " + (1 - sAdj2_val) * h + ",L" + (0.5 + sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ",L " + (0.5 + sAdj1_val) * w + " 0 z",
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -3695,11 +3704,11 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points= (w * 1.0 / 2) + " 0,0 " + sAdj2_val * h + "," + (0.5 - sAdj1_val) * w + " " + sAdj2_val * h + "," + (0.5 - sAdj1_val) * w + " " + h +
|
|
|
- "," + (0.5 + sAdj1_val) * w + " " + h + "," + (0.5 + sAdj1_val) * w + " " + sAdj2_val * h + ", " + w + " " + sAdj2_val * h ,
|
|
|
+ d= "M"+(w * 1.0 / 2) + " 0,0 " + sAdj2_val * h + ",L" + (0.5 - sAdj1_val) * w + " " + sAdj2_val * h + ",L" + (0.5 - sAdj1_val) * w + " " + h +
|
|
|
+ ",L" + (0.5 + sAdj1_val) * w + " " + h + ",L" + (0.5 + sAdj1_val) * w + " " + sAdj2_val * h + ",L" + w + " " + sAdj2_val * h +" z" ,
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -3742,11 +3751,11 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points= "0 " + h * 1.0 / 2 + "," + sAdj2_val * w + " " + h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + "," + (1 - sAdj2_val) * w + " " + (1 - sAdj1_val) * h +
|
|
|
- "," + (1 - sAdj2_val) * w + " " + h + "," + w + " " + h * 1.0 / 2 + ", " + (1 - sAdj2_val) * w + " 0," + (1 - sAdj2_val) * w + " " + sAdj1_val * h + "," +
|
|
|
- sAdj2_val * w + " " + sAdj1_val * h + "," + sAdj2_val * w + " 0",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d= "M0 " + h * 1.0 / 2 + ",L" + sAdj2_val * w + " " + h + ",L" + sAdj2_val * w + " " + (1 - sAdj1_val) * h + ",L" + (1 - sAdj2_val) * w + " " + (1 - sAdj1_val) * h +
|
|
|
+ ",L" + (1 - sAdj2_val) * w + " " + h + ",L" + w + " " + h * 1.0 / 2 + ",L" + (1 - sAdj2_val) * w + " 0,L" + (1 - sAdj2_val) * w + " " + sAdj1_val * h + ",L" +
|
|
|
+ sAdj2_val * w + " " + sAdj1_val * h + ",L" + sAdj2_val * w + " 0 z",
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -3777,12 +3786,12 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points= w * 1.0 / 2 + " 0,0 " + sAdj2_val * h + "," + sAdj1_val * w + " " + sAdj2_val * h + "," + sAdj1_val * w + " " + (1 - sAdj2_val) * h +
|
|
|
- ",0 " + (1 - sAdj2_val) * h + "," + w * 1.0 / 2 + " " + h + ", " + w + " " + (1 - sAdj2_val) * h + "," + (1 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + "," +
|
|
|
- (1 - sAdj1_val) * w + " " + sAdj2_val * h + "," + w + " " + sAdj2_val * h ,
|
|
|
+ d="M"+ w * 1.0 / 2 + " 0,L0 " + sAdj2_val * h + "," + sAdj1_val * w + " " + sAdj2_val * h + ",L" + sAdj1_val * w + " " + (1 - sAdj2_val) * h +
|
|
|
+ ",L0 " + (1 - sAdj2_val) * h + ",L" + w * 1.0 / 2 + " " + h + ",L" + w + " " + (1 - sAdj2_val) * h + ",L" + (1 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ",L" +
|
|
|
+ (1 - sAdj1_val) * w + " " + sAdj2_val * h + ",L" + w + " " + sAdj2_val * h+" z" ,
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8075,10 +8084,9 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
|
|
|
string points = ShapeStar(adj, double.Parse(starNum));
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
-
|
|
|
- points=points
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d=points
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8089,13 +8097,20 @@ namespace HTEXLib.Helpers
|
|
|
var numPoints = starNum;/*1-100*/
|
|
|
var center =System. Math.Max(innerRadius, outerRadius);
|
|
|
var angle = System.Math.PI * 1.0 / numPoints;
|
|
|
- var points = "";
|
|
|
-
|
|
|
- for (var i = 0; i < numPoints * 2; i++)
|
|
|
+ var points = "M";
|
|
|
+ var len = numPoints * 2;
|
|
|
+ for (var i = 0; i < len; i++)
|
|
|
{
|
|
|
var radius = ((i % 2) > 0) ? innerRadius : outerRadius;
|
|
|
- points += center + radius * System.Math.Sin(i * angle);
|
|
|
- points += center - radius * System.Math.Cos(i * angle);
|
|
|
+ points += center + radius * System.Math.Sin(i * angle)+" ";
|
|
|
+ if (i == len - 1)
|
|
|
+ {
|
|
|
+ points += center - radius * System.Math.Cos(i * angle) + " z";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ points += center - radius * System.Math.Cos(i * angle) + ",L";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return points;
|
|
@@ -8115,10 +8130,10 @@ namespace HTEXLib.Helpers
|
|
|
/// <returns></returns>
|
|
|
private static Svg Dodecagon(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points= (3 * 1.0 / 8) * w + " 0," + w * 1.0 / 8 + " " + h * 1.0 / 8 + ",0 " + (3 * 1.0 / 8) * h + ",0 " + (5 * 1.0 / 8) * h + "," + w * 1.0 / 8 + " " + (7 * 1.0 / 8) * h + "," + (3 * 1.0 / 8) * w + " " + h + "," +
|
|
|
- (5 * 1.0 / 8) * w + " " + h + "," + (7 * 1.0 / 8) * w + " " + (7 * 1.0 / 8) * h + "," + w + " " + (5 * 1.0 / 8) * h + "," + w + " " + (3 * 1.0 / 8) * h + "," + (7 * 1.0 / 8) * w + " " + h * 1.0 / 8 + "," + (5 * 1.0 / 8) * w + " 0"
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d= "M"+(3 * 1.0 / 8) * w + " 0,L" + w * 1.0 / 8 + " " + h * 1.0 / 8 + ",L0 " + (3 * 1.0 / 8) * h + ",L0 " + (5 * 1.0 / 8) * h + ",L" + w * 1.0 / 8 + " " + (7 * 1.0 / 8) * h + ",L" + (3 * 1.0 / 8) * w + " " + h + ",L" +
|
|
|
+ (5 * 1.0 / 8) * w + " " + h + ",L" + (7 * 1.0 / 8) * w + " " + (7 * 1.0 / 8) * h + ",L" + w + " " + (5 * 1.0 / 8) * h + ",L" + w + " " + (3 * 1.0 / 8) * h + ",L" + (7 * 1.0 / 8) * w + " " + h * 1.0 / 8 + ",L" + (5 * 1.0 / 8) * w + " 0 z"
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8137,10 +8152,10 @@ namespace HTEXLib.Helpers
|
|
|
/// <returns></returns>
|
|
|
private static Svg Decagon(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points= (3 * 1.0 / 8) * w + " 0," + w * 1.0 / 8 + " " + h * 1.0 / 8 + ",0 " + h * 1.0 / 2 + "," + w * 1.0 / 8 + " " + (7 * 1.0 / 8) * h + "," + (3 * 1.0 / 8) * w + " " + h + "," +
|
|
|
- (5 * 1.0 / 8) * w + " " + h + "," + (7 * 1.0 / 8) * w + " " + (7 * 1.0 / 8) * h + "," + w + " " + h * 1.0 / 2 + "," + (7 * 1.0 / 8) * w + " " + h * 1.0 / 8 + "," + (5 * 1.0 / 8) * w + " 0"
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d="M"+ (3 * 1.0 / 8) * w + " 0,L" + w * 1.0 / 8 + " " + h * 1.0 / 8 + ",L0 " + h * 1.0 / 2 + ",L" + w * 1.0 / 8 + " " + (7 * 1.0 / 8) * h + ",L" + (3 * 1.0 / 8) * w + " " + h + ",L" +
|
|
|
+ (5 * 1.0 / 8) * w + " " + h + ",L" + (7 * 1.0 / 8) * w + " " + (7 * 1.0 / 8) * h + ",L" + w + " " + h * 1.0 / 2 + ",L" + (7 * 1.0 / 8) * w + " " + h * 1.0 / 8 + ",L" + (5 * 1.0 / 8) * w + " 0 z"
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8175,11 +8190,10 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
double adj2 = (1 - adj1);
|
|
|
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
-
|
|
|
- points= adj1 * w + " 0,0 " + adj1 * h + ",0 " + adj2 * h + "," + adj1 * w + " " + h + "," + adj2 * w + " " + h + "," +
|
|
|
- w + " " + adj2 * h + "," + w + " " + adj1 * h + "," + adj2 * w + " 0"
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d= "M"+ adj1 * w + " 0,L0 " + adj1 * h + ",L0 " + adj2 * h + ",L" + adj1 * w + " " + h + ",L" + adj2 * w + " " + h + ",L" +
|
|
|
+ w + " " + adj2 * h + ",L" + w + " " + adj1 * h + ",L" + adj2 * w + " 0"
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8199,11 +8213,10 @@ namespace HTEXLib.Helpers
|
|
|
private static Svg Heptagon(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
-
|
|
|
- points=(0.5 * w) + " 0," + w*1.0 / 8 + " " + h*1.0 / 4.0+ ",0 " + (5*1.0 / 8.0) * h + "," + w*1.0 / 4.0+ " " + h + "," + (3*1.0 / 4.0) * w + " " + h + "," +
|
|
|
- w + " " + (5*1.0 / 8.0) * h + "," + (7*1.0 / 8.0) * w + " " + h*1.0 / 4.0
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d="M"+(0.5 * w) + " 0,L" + w*1.0 / 8 + " " + h*1.0 / 4.0+ ",L0 " + (5*1.0 / 8.0) * h + ",L" + w*1.0 / 4.0+ " " + h + ",L" + (3*1.0 / 4.0) * w + " " + h + ",L" +
|
|
|
+ w + " " + (5*1.0 / 8.0) * h + ",L" + (7*1.0 / 8.0) * w + " " + h*1.0 / 4.0+" z"
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8263,9 +8276,9 @@ namespace HTEXLib.Helpers
|
|
|
}
|
|
|
private static Svg Pentagon(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points = (0.5 * w) + " 0,0 " + (0.375 * h) + "," + (0.15 * w) + " " + h + "," + 0.85 * w + " " + h + "," + w + " " + 0.375 * h ,
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d ="M" +(0.5 * w) + " 0,L0 " + (0.375 * h) + ",L" + (0.15 * w) + " " + h + ",L" + 0.85 * w + " " + h + ",L" + w + " " + 0.375 * h+" z" ,
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8306,10 +8319,10 @@ namespace HTEXLib.Helpers
|
|
|
double adjst = double.Parse(shapAdjst.Value.Substring(4)) * 1.0 / 100000;
|
|
|
adjst_val = adjst * 1.0 / max_adj_const;
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points = adjst_val * w + " 0,0 " + h + "," + (1 - adjst_val) * w + " " + h + "," + w + " 0",
|
|
|
+ d ="M"+ adjst_val * w + " 0,L0 " + h + ",L" + (1 - adjst_val) * w + " " + h + ",L" + w + " 0 z",
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8352,9 +8365,9 @@ namespace HTEXLib.Helpers
|
|
|
adjst_val = 0;
|
|
|
cnstVal = h * 1.0 / 5;
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points = (w * adjst_val) + " " + cnstVal + ",0 " + h + "," + w + " " + h + "," + (1 - adjst_val) * w + " 0" ,
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d = "M"+(w * adjst_val) + " " + cnstVal + ",L0 " + h + ",L" + w + " " + h + ",L" + (1 - adjst_val) * w + " 0 z" ,
|
|
|
transform=transform
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
@@ -8374,18 +8387,18 @@ namespace HTEXLib.Helpers
|
|
|
/// <returns></returns>
|
|
|
private static Svg Diamond(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
|
|
|
- points =(w*1.0 / 2.0) + " 0,0 " + (h*1.0 / 2.0) + "," + (w*1.0 / 2.0) + " " + h + "," + w + " " + (h*1.0 / 2.0),
|
|
|
+ d ="M"+(w*1.0 / 2.0) + " 0,L0 " + (h*1.0 / 2.0) + ",L" + (w*1.0 / 2.0) + " " + h + ",L" + w + " " + (h*1.0 / 2.0)+" z",
|
|
|
} };
|
|
|
if (shapType == "flowChartSort")
|
|
|
{
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
+ type = "path",
|
|
|
|
|
|
- points = "0 " + h * 1.0 / 2.0 + "," + w + " " + h * 1.0 / 2.0
|
|
|
+ d = "M0 " + h * 1.0 / 2.0 + ",L" + w + " " + h * 1.0 / 2.0
|
|
|
});
|
|
|
}
|
|
|
return new Svg { svgShape = shapes };
|
|
@@ -8423,9 +8436,9 @@ namespace HTEXLib.Helpers
|
|
|
{
|
|
|
transform = "rotate(180 " + w * 1.0 / 2.0 + "," + h * 1.0 / 2.0 + ")";
|
|
|
}
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points =(w * shapAdjst_val) + " 0,0 " + h + "," + w + " " + h,
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d ="M"+(w * shapAdjst_val) + " 0,L0 " + h + ",L" + w + " " + h+" z",
|
|
|
transform=transform
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
@@ -8445,9 +8458,9 @@ namespace HTEXLib.Helpers
|
|
|
/// <returns></returns>
|
|
|
private static Svg RtTriangle(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
|
|
|
- type = "polygon",
|
|
|
- points ="0 0,0 " + h + "," + w + " " + h
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
+ type = "path",
|
|
|
+ d ="M0 0,L0 " + h + ",L" + w + " " + h+" z"
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
|
}
|
|
@@ -8687,27 +8700,35 @@ namespace HTEXLib.Helpers
|
|
|
/// <returns></returns>
|
|
|
private static Svg Ellipse(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
- List<SvgShape> shapes = new List<SvgShape>() {new Ellipse {
|
|
|
- type = "ellipse",
|
|
|
-
|
|
|
- cx= (w*1.0 / 2.0),
|
|
|
- cy=(h*1.0 / 2.0) ,
|
|
|
- rx=(w*1.0 / 2.0),
|
|
|
- ry= (h*1.0 / 2.0)
|
|
|
- } };
|
|
|
+ List<SvgShape> shapes = new List<SvgShape>() {
|
|
|
+ new SvgPath{
|
|
|
+ type="path",
|
|
|
+ d="M" + ((w*1.0 / 2.0)-(w*1.0 / 2.0)) + " " + (h*1.0 / 2.0) +
|
|
|
+ " a" + (w*1.0 / 2.0) + " " + (h*1.0 / 2.0) + " 0 1 0 " + 2*(w*1.0 / 2.0) + " 0" +
|
|
|
+ " a" + (w*1.0 / 2.0) + " " + (h*1.0 / 2.0) + " 0 1 0 " + (-2*(w*1.0 / 2.0)) + " 0" +
|
|
|
+ " z"
|
|
|
+ }
|
|
|
+ //new Ellipse {
|
|
|
+ // type = "ellipse",
|
|
|
+ // cx= (w*1.0 / 2.0),
|
|
|
+ // cy=(h*1.0 / 2.0) ,
|
|
|
+ // rx=(w*1.0 / 2.0),
|
|
|
+ // ry= (h*1.0 / 2.0)
|
|
|
+ //}
|
|
|
+ };
|
|
|
if (shapType == "flowChartOr")
|
|
|
{
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
+ type = "path",
|
|
|
|
|
|
- points = w * 1.0 / .0 + " " + 0 + "," + w * 1.0 / 2.0,
|
|
|
+ d = "M"+w * 1.0 / .0 + " " + 0 + ",L" + w * 1.0 / 2.0,
|
|
|
});
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
+ type = "path",
|
|
|
|
|
|
- points = 0 + " " + h * 1.0 / 2.0 + "," + w + " " + h * 1.0 / 2.0,
|
|
|
+ d ="M"+ 0 + " " + h * 1.0 / 2.0 + ",L" + w + " " + h * 1.0 / 2.0,
|
|
|
});
|
|
|
}
|
|
|
else if (shapType == "flowChartSummingJunction")
|
|
@@ -8720,17 +8741,17 @@ namespace HTEXLib.Helpers
|
|
|
ir = hc + idx;
|
|
|
it = vc - idy;
|
|
|
ib = vc + idy;
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
+ type = "path",
|
|
|
|
|
|
- points = il + " " + it + "," + ir + " " + ib,
|
|
|
+ d = "M"+il + " " + it + ",L" + ir + " " + ib,
|
|
|
});
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
+ type = "path",
|
|
|
|
|
|
- points = ir + " " + it + "," + il + " " + ib,
|
|
|
+ d = "M" + ir + " " + it + ",L" + il + " " + ib,
|
|
|
});
|
|
|
}
|
|
|
return new Svg { svgShape = shapes };
|
|
@@ -8780,7 +8801,6 @@ namespace HTEXLib.Helpers
|
|
|
" z";
|
|
|
List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
|
|
|
type = "path",
|
|
|
-
|
|
|
d=d,
|
|
|
} };
|
|
|
return new Svg { svgShape = shapes };
|
|
@@ -9819,36 +9839,58 @@ namespace HTEXLib.Helpers
|
|
|
private static Svg Rect(OpenXmlElement node, string shapType, double w, double h, Border border)
|
|
|
{
|
|
|
List<SvgShape> shapes = new List<SvgShape>();
|
|
|
- shapes.Add(new Rect
|
|
|
+ //shapes.Add(new Rect
|
|
|
+ //{
|
|
|
+ // type = "rect",
|
|
|
+ // x = 0,
|
|
|
+ // y = 0,
|
|
|
+ // width = w,
|
|
|
+ // height =h,
|
|
|
+ //});
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "rect",
|
|
|
- x = 0,
|
|
|
- y = 0,
|
|
|
- width = w,
|
|
|
- height =h,
|
|
|
+ type = "path",
|
|
|
+ // d = "M" + 0 + " " + 0 + "h" + w + "v" + h + "h" + (-w) + " z"
|
|
|
+ d = "M" + 0 + " " + 0 + ",L" + w + " " + 0 + ",L" + w+" "+h+",L"+0+" "+h + " z"
|
|
|
+ //x = 0,
|
|
|
+ //y = 0,
|
|
|
+ //width = w,
|
|
|
+ //height = h,
|
|
|
});
|
|
|
+ //if (shapType == "flowChartPredefinedProcess")
|
|
|
+ //{
|
|
|
+ // shapes.Add(new Rect
|
|
|
+ // {
|
|
|
+ // type = "rect",
|
|
|
+ // x = w * (1.0 / 8.0),
|
|
|
+ // y = 0,
|
|
|
+ // width = w * (6.0 / 8.0),
|
|
|
+ // height = h,
|
|
|
+ // });
|
|
|
+ //}
|
|
|
if (shapType == "flowChartPredefinedProcess")
|
|
|
{
|
|
|
- shapes.Add(new Rect
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "rect",
|
|
|
- x = w * (1.0 / 8.0),
|
|
|
- y = 0,
|
|
|
- width = w * (6.0 / 8.0),
|
|
|
- height = h,
|
|
|
+ type = "path",
|
|
|
+ d = "M" + w * (1.0 / 8.0) + " " + 0 + ",L" + (w * (7.0 / 8.0)) + " " + 0 + ",L" + (w * (7.0 / 8.0)) + " " + h + ",L" + w * (1.0 / 8.0) + " " + h+ " z"
|
|
|
+ //x = w * (1.0 / 8.0),
|
|
|
+ //y = 0,
|
|
|
+ //width = w * (6.0 / 8.0),
|
|
|
+ //height = h,
|
|
|
});
|
|
|
}
|
|
|
else if (shapType == "flowChartInternalStorage")
|
|
|
{
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
- points = w * (1.0/ 8.0) + " 0," + w * (1.0 / 8.0) + " " + h,
|
|
|
+ type = "path",
|
|
|
+ d = "M"+w * (1.0/ 8.0) + " 0,L" + w * (1.0 / 8.0) + " " + h,
|
|
|
});
|
|
|
- shapes.Add(new Polyline
|
|
|
+ shapes.Add(new SvgPath
|
|
|
{
|
|
|
- type = "polyline",
|
|
|
- points = h * (1.0 / 8.0) + "," + w + " " + h * (1.0 / 8.0),
|
|
|
+ type = "path",
|
|
|
+ d = "M" +h * (1.0 / 8.0) + ",L" + w + " " + h * (1.0 / 8.0),
|
|
|
});
|
|
|
}
|
|
|
return new Svg { svgShape = shapes };
|