OSDN Git Service

SVGPathSegXXインターフェースの変更にともない、createXXXメソッドも修正
authordhrname <sie-developers@lists.sourceforge.jp>
Fri, 31 Oct 2014 13:49:18 +0000 (22:49 +0900)
committerdhrname <sie-developers@lists.sourceforge.jp>
Fri, 31 Oct 2014 13:49:18 +0000 (22:49 +0900)
org/w3c/dom/svg.js

index a3edb28..4f35d34 100644 (file)
@@ -2492,38 +2492,14 @@ base("$SVGPathSegCurvetoCubicAbs").mix( {
     pathSegType : /*SVGPathSeg.PATHSEG_ARC_REL*/ 11,\r
     pathSegTypeAsLetter : "a"\r
   } );\r
-  _.up("$SVGPathSegLinetoHorizontalAbs").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS*/ 12,\r
-    pathSegTypeAsLetter: "H"\r
-  } );\r
-  _.up("$SVGPathSegLinetoHorizontalRel").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL*/ 13,\r
-    pathSegTypeAsLetter: "h"\r
-  } );\r
-  _.up("$SVGPathSegLinetoVerticalAbs").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS*/ 14,\r
-    pathSegTypeAsLetter: "V"\r
-  } );\r
-  _.up("$SVGPathSegLinetoVerticalRel").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL*/ 15,\r
-    pathSegTypeAsLetter: "v"\r
-  } );\r
-  _.up("$SVGPathSegCurvetoCubicSmoothAbs").mix( {\r
-    pathSegType:/*SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS*/ 16,\r
-    pathSegTypeAsLetter: "S"\r
-  } );\r
-  _.up("$SVGPathSegCurvetoCubicSmoothRel").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL*/ 17,\r
-    pathSegTypeAsLetter: "s"\r
-  } );\r
-  _.up("$SVGPathSegCurvetoQuadraticSmoothAbs").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS*/ 18,\r
-    pathSegTypeAsLetter: "T"\r
-  } );\r
-  _.up("$SVGPathSegCurvetoQuadraticSmoothRel").mix( {\r
-    pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL*/ 19,\r
-    pathSegTypeAsLetter: "t"\r
-  } );\r
+  /*SVGPathSegLinetoHorizontalAbsは$SVGPathElementのファクトリーメソッドで実装\r
+   * SVGPathSegLinetoHorizontalRel\r
+   * SVGPathSegLinetoVerticalAbs\r
+   * SVGPathSegLinetoVerticalRel\r
+   SVGPathSegCurvetoCubicSmoothAbs\r
+   SVGPathSegCurvetoCubicSmoothRel\r
+   SVGPathSegCurvetoQuadraticSmoothAbs\r
+   SVGPathSegCurvetoQuadraticSmoothRelも同様*/\r
 } );\r
 \r
 /*documentは引数の変数として登録しておく*/\r
@@ -3244,7 +3220,7 @@ _com: {
     return s;\r
   },\r
   /*SVGPathSegCurvetoCubicRel*/    createSVGPathSegCurvetoCubicRel: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) {\r
-    var s = new SVGPathSegCurvetoCubicRel();\r
+    var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegCurvetoCubicRel.up();\r
     s.x = x;\r
     s.y = y;\r
     s.x1 = x1;\r
@@ -3254,7 +3230,7 @@ _com: {
     return s;\r
   },\r
   /*SVGPathSegCurvetoQuadraticAbs*/    createSVGPathSegCurvetoQuadraticAbs: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) {\r
-    var s = new SVGPathSegCurvetoQuadraticAbs();\r
+    var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegCurvetoQuadraticAbs.up();\r
     s.x = x;\r
     s.y = y;\r
     s.x1 = x1;\r
@@ -3262,7 +3238,7 @@ _com: {
     return s;\r
   },\r
   /*SVGPathSegCurvetoQuadraticRel*/    createSVGPathSegCurvetoQuadraticRel: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) {\r
-    var s = new SVGPathSegCurvetoQuadraticRel();\r
+    var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegCurvetoQuadraticRel.up();\r
     s.x = x;\r
     s.y = y;\r
     s.x1 = x1;\r
@@ -3270,7 +3246,7 @@ _com: {
     return s;\r
   },\r
   /*SVGPathSegArcAbs*/    createSVGPathSegArcAbs: function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) {\r
-    var s = new SVGPathSegArcAbs();\r
+    var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegArcAbs.up();\r
     s.x = x;\r
     s.y = y;\r
     s.r1 = r1;\r
@@ -3281,7 +3257,7 @@ _com: {
     return s;\r
   },\r
   /*SVGPathSegArcRel*/    createSVGPathSegArcRel: function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) {\r
-    var s = new SVGPathSegArcRel();\r
+    var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegArcRel.up();\r
     s.x = x;\r
     s.y = y;\r
     s.r1 = r1;\r
@@ -3292,56 +3268,72 @@ _com: {
     return s;\r
   },\r
   /*SVGPathSegLinetoHorizontalAbs*/    createSVGPathSegLinetoHorizontalAbs: function(/*float*/ x ) {\r
-    var s = new SVGPathSegLinetoHorizontalAbs();\r
-    s.x = x;\r
-    s.y = 0; //DOMでは指定されていないが、変換処理が楽なので用いる\r
-    return s;\r
+    return {\r
+      x: x,\r
+      y: 0, //DOMでは指定されていないが、変換処理が楽なので用いる\r
+      pathSegType: /*SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS*/ 12,\r
+      pathSegTypeAsLetter: "H"\r
+    };\r
   },\r
   /*SVGPathSegLinetoHorizontalRel*/    createSVGPathSegLinetoHorizontalRel: function(/*float*/ x ) {\r
-    var s = new SVGPathSegLinetoHorizontalRel();\r
-    s.x = x;\r
-    s.y = 0;\r
-    return s;\r
+    return {\r
+      x: x,\r
+      y: 0,\r
+      pathSegType: /*SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL*/ 13,\r
+      pathSegTypeAsLetter: "h"\r
+    };\r
   },\r
   /*SVGPathSegLinetoVerticalAbs*/    createSVGPathSegLinetoVerticalAbs: function(/*float*/ y ) {\r
-    var s = new SVGPathSegLinetoVerticalAbs();\r
-    s.x = 0;\r
-    s.y = y;\r
-    return s;\r
+    return {\r
+      x: 0,\r
+      y: y,\r
+      pathSegType: /*SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS*/ 14,\r
+      pathSegTypeAsLetter: "V"\r
+    };\r
   },\r
   /*SVGPathSegLinetoVerticalRel*/    createSVGPathSegLinetoVerticalRel: function(/*float*/ y ) {\r
-    var s = new SVGPathSegLinetoVerticalRel();\r
-    s.x = 0;\r
-    s.y = y;\r
-    return s;\r
+    return {\r
+      x: 0,\r
+      y: y,\r
+      pathSegType: /*SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL*/ 15,\r
+      pathSegTypeAsLetter: "v"\r
+    };\r
   },\r
   /*SVGPathSegCurvetoCubicSmoothAbs*/    createSVGPathSegCurvetoCubicSmoothAbs: function(/*float*/ x, /*float*/ y, /*float*/ x2, /*float*/ y2 ) {\r
-    var s = new SVGPathSegCurvetoCubicSmoothAbs();\r
-    s.x = x;\r
-    s.y = y;\r
-    s.x2 = x2;\r
-    s.y2 = y2;\r
-    return s;\r
+    return {\r
+      x: x,\r
+      y: y,\r
+      x2: x2,\r
+      y2: y2,\r
+      pathSegType:/*SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS*/ 16,\r
+      pathSegTypeAsLetter: "S"\r
+    };\r
   },\r
   /*SVGPathSegCurvetoCubicSmoothRel*/    createSVGPathSegCurvetoCubicSmoothRel: function(/*float*/ x, /*float*/ y, /*float*/ x2, /*float*/ y2 ) {\r
-    var s = new SVGPathSegCurvetoCubicSmoothRel();\r
-    s.x = x;\r
-    s.y = y;\r
-    s.x2 = x2;\r
-    s.y2 = y2;\r
-    return s;\r
+    return {\r
+      x: x,\r
+      y: y,\r
+      x2: x2,\r
+      y2: y2,\r
+      pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL*/ 17,\r
+      pathSegTypeAsLetter: "s"\r
+    };\r
   },\r
   /*SVGPathSegCurvetoQuadraticSmoothAbs*/    createSVGPathSegCurvetoQuadraticSmoothAbs: function(/*float*/ x, /*float*/ y ) {\r
-    var s = new SVGPathSegCurvetoQuadraticSmoothAbs();\r
-    s.x = x;\r
-    s.y = y;\r
-    return s;\r
+    return {\r
+      x: x,\r
+      y: y,\r
+      pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS*/ 18,\r
+      pathSegTypeAsLetter: "T"\r
+    };\r
   },\r
   /*SVGPathSegCurvetoQuadraticSmoothRel*/    createSVGPathSegCurvetoQuadraticSmoothRel: function(/*float*/ x, /*float*/ y ) {\r
-    var s = new SVGPathSegCurvetoQuadraticSmoothRel();\r
-    s.x = x;\r
-    s.y = y;\r
-    return s;\r
+    return {\r
+      x: x,\r
+      y: y,\r
+      pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL*/ 19,\r
+      pathSegTypeAsLetter: "t"\r
+    };\r
   }\r
 } );\r
 })(document, Math);\r