From 0eceab013fecadf77d99cdac580c95c74761dd69 Mon Sep 17 00:00:00 2001 From: dhrname Date: Fri, 31 Oct 2014 23:23:02 +0900 Subject: [PATCH] =?utf8?q?SVGPathSegXXX=E3=82=A4=E3=83=B3=E3=82=BF?= =?utf8?q?=E3=83=BC=E3=83=95=E3=82=A7=E3=83=BC=E3=82=B9=E3=82=92=E6=8E=92?= =?utf8?q?=E9=99=A4=E3=81=97=E3=80=81=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7?= =?utf8?q?=E3=82=AF=E3=83=88=E3=83=AA=E3=83=86=E3=83=A9=E3=83=AB=E3=82=92?= =?utf8?q?=E3=81=8B=E3=82=8F=E3=82=8A=E3=81=AB=E4=BD=BF=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- org/w3c/dom/svg.js | 239 ++++++++++++++++++++--------------------------------- 1 file changed, 88 insertions(+), 151 deletions(-) diff --git a/org/w3c/dom/svg.js b/org/w3c/dom/svg.js index 4f35d34..031fc62 100644 --- a/org/w3c/dom/svg.js +++ b/org/w3c/dom/svg.js @@ -2413,94 +2413,8 @@ function SVGPathSeg() { /*unsigned short t.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; })(SVGPathSeg);*/ /*SVGPathSegxx - *軽量化のために、SVGPathSegの継承をしない。 - */ -base("$SVGPathSegClosePath").mix( { - pathSegType : /*SVGPathSeg.PATHSEG_CLOSEPATH*/ 1, - pathSegTypeAsLetter : "z" -} ); - -base("$SVGPathSegMovetoAbs").mix( { - /*float*/ x: 0, - /*float*/ y: 0, - pathSegType : /*SVGPathSeg.PATHSEG_MOVETO_ABS*/ 2, - pathSegTypeAsLetter : "M" -} ).mix( function(_) { - - _.up("$SVGPathSegMovetoRel").mix( { - pathSegType : /*SVGPathSeg.PATHSEG_MOVETO_REL*/ 3, - pathSegTypeAsLetter : "m" - } ); - - _.up("$SVGPathSegLinetoAbs").mix( { - pathSegType : /*SVGPathSeg.PATHSEG_LINETO_ABS*/ 4, - pathSegTypeAsLetter : "L" - } ); - - _.up("$SVGPathSegLinetoRel").mix( { - pathSegType : /*SVGPathSeg.PATHSEG_LINETO_REL*/ 5, - pathSegTypeAsLetter : "l" - } ); - -} ); - -base("$SVGPathSegCurvetoCubicAbs").mix( { - /*float*/x: 0, - /*float*/ y: 0, - /*float*/ x1: 0, - /*float*/ y1: 0, - /*float*/ x2: 0, - /*float*/ y2: 0, - pathSegType : /*SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS*/ 6, - pathSegTypeAsLetter : "C" -} ).mix( function(_) { - - _.up("$SVGPathSegCurvetoCubicRel").mix( { - pathSegType : /*SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL*/ 7, - pathSegTypeAsLetter : "c" - } ); - - _.up("$SVGPathSegCurvetoQuadraticAbs").mix( { - pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS*/ 8, - pathSegTypeAsLetter: "Q" - } ); - - _.up("$SVGPathSegCurvetoQuadraticRel").mix( { - pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL*/ 9, - pathSegTypeAsLetter: "q" - } ); - - _.up("$SVGPathSegArcAbs").mix( { - /*float this.x; - /*float this.y; - /*float this.r1; - /*float this.r2; - /*float this.angle;*/ - /*boolean*/ largeArcFlag : true, - /*boolean*/ sweepFlag : true, - pathSegType : /*SVGPathSeg.PATHSEG_ARC_ABS*/ 10, - pathSegTypeAsLetter : "A" - } ); - _.up("$SVGPathSegArcRel").mix( { - /*float this.x; - /*float this.y; - /*float this.r1; - /*float this.r2; - /*float this.angle;*/ - /*boolean*/ largeArcFlag : true, - /*boolean*/ sweepFlag : true, - pathSegType : /*SVGPathSeg.PATHSEG_ARC_REL*/ 11, - pathSegTypeAsLetter : "a" - } ); - /*SVGPathSegLinetoHorizontalAbsは$SVGPathElementのファクトリーメソッドで実装 - * SVGPathSegLinetoHorizontalRel - * SVGPathSegLinetoVerticalAbs - * SVGPathSegLinetoVerticalRel - SVGPathSegCurvetoCubicSmoothAbs - SVGPathSegCurvetoCubicSmoothRel - SVGPathSegCurvetoQuadraticSmoothAbs - SVGPathSegCurvetoQuadraticSmoothRelも同様*/ -} ); + *軽量化のために、SVGPathSegの実装をしない。 + $SVGPathElementのファクトリーメソッドで実装*/ /*documentは引数の変数として登録しておく*/ (function(_doc, _math) { @@ -3183,89 +3097,112 @@ _com: { return (nl.numberOfItems - 1); }, /*SVGPathSegClosePath*/ createSVGPathSegClosePath: function() { - return base("$SVGPathSegClosePath").up(); + return { + pathSegType : /*SVGPathSeg.PATHSEG_CLOSEPATH*/ 1, + pathSegTypeAsLetter : "z" + }; }, /*SVGPathSegMovetoAbs*/ createSVGPathSegMovetoAbs: function(/*float*/ x, /*float*/ y ) { - var s = base("$SVGPathSegMovetoAbs").up(); - s.x = x; - s.y = y; - return s; + return { + x: x, + y: y, + pathSegType : /*SVGPathSeg.PATHSEG_MOVETO_ABS*/ 2, + pathSegTypeAsLetter : "M" + }; }, /*SVGPathSegMovetoRel*/ createSVGPathSegMovetoRel: function(/*float*/ x, /*float*/ y ) { - var s = base("$SVGPathSegMovetoAbs").$SVGPathSegMovetoRel.up(); - s.x = x; - s.y = y; - return s; + return { + x: x, + y: y, + pathSegType : /*SVGPathSeg.PATHSEG_MOVETO_REL*/ 3, + pathSegTypeAsLetter : "m" + }; }, /*SVGPathSegLinetoAbs*/ createSVGPathSegLinetoAbs: function(/*float*/ x, /*float*/ y ) { - var s = base("$SVGPathSegMovetoAbs").$SVGPathSegLinetoAbs.up(); - s.x = x; - s.y = y; - return s; + return { + x: x, + y: y, + pathSegType : /*SVGPathSeg.PATHSEG_LINETO_ABS*/ 4, + pathSegTypeAsLetter : "L" + }; }, /*SVGPathSegLinetoRel*/ createSVGPathSegLinetoRel: function(/*float*/ x, /*float*/ y ) { - var s = base("$SVGPathSegMovetoAbs").$SVGPathSegLinetoRel.up(); - s.x = x; - s.y = y; - return s; + return { + x: x, + y: y, + pathSegType : /*SVGPathSeg.PATHSEG_LINETO_REL*/ 5, + pathSegTypeAsLetter : "l" + }; }, /*SVGPathSegCurvetoCubicAbs*/ createSVGPathSegCurvetoCubicAbs: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) { - var s = base("$SVGPathSegCurvetoCubicAbs").up(); - s.x = x; - s.y = y; - s.x1 = x1; - s.y1 = y1; - s.x2 = x2; - s.y2 = y2; - return s; + return { + x: x, + y: y, + x1: x1, + y1: y1, + x2: x2, + y2: y2, + pathSegType : /*SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS*/ 6, + pathSegTypeAsLetter : "C" + }; }, /*SVGPathSegCurvetoCubicRel*/ createSVGPathSegCurvetoCubicRel: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) { - var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegCurvetoCubicRel.up(); - s.x = x; - s.y = y; - s.x1 = x1; - s.y1 = y1; - s.x2 = x2; - s.y2 = y2; - return s; + return { + x: x, + y: y, + x1: x1, + y1: y1, + x2: x2, + y2: y2, + pathSegType : /*SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL*/ 7, + pathSegTypeAsLetter : "c" + }; }, /*SVGPathSegCurvetoQuadraticAbs*/ createSVGPathSegCurvetoQuadraticAbs: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) { - var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegCurvetoQuadraticAbs.up(); - s.x = x; - s.y = y; - s.x1 = x1; - s.y1 = y1; - return s; + return { + x: x, + y: y, + x1: x1, + y1: y1, + pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS*/ 8, + pathSegTypeAsLetter: "Q" + }; }, /*SVGPathSegCurvetoQuadraticRel*/ createSVGPathSegCurvetoQuadraticRel: function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) { - var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegCurvetoQuadraticRel.up(); - s.x = x; - s.y = y; - s.x1 = x1; - s.y1 = y1; - return s; + return { + x: x, + y: y, + x1: x1, + y1: y1, + pathSegType: /*SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL*/ 9, + pathSegTypeAsLetter: "q" + }; }, /*SVGPathSegArcAbs*/ createSVGPathSegArcAbs: function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) { - var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegArcAbs.up(); - s.x = x; - s.y = y; - s.r1 = r1; - s.r2 = r2; - s.angle = angle; - s.largeArcFlag = largeArcFlag; - s.sweepFlag = sweepFlag; - return s; + return { + x: x, + y: y, + r1: r1, + r2: r2, + angle: angle, + largeArcFlag: largeArcFlag, + sweepFlag: sweepFlag, + pathSegType : /*SVGPathSeg.PATHSEG_ARC_ABS*/ 10, + pathSegTypeAsLetter : "A" + }; }, /*SVGPathSegArcRel*/ createSVGPathSegArcRel: function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) { - var s = base("$SVGPathSegCurvetoCubicAbs").$SVGPathSegArcRel.up(); - s.x = x; - s.y = y; - s.r1 = r1; - s.r2 = r2; - s.angle = angle; - s.largeArcFlag = largeArcFlag; - s.sweepFlag = sweepFlag; - return s; + return { + x: x, + y: y, + r1: r1, + r2: r2, + angle: angle, + largeArcFlag: largeArcFlag, + sweepFlag: sweepFlag, + pathSegType : /*SVGPathSeg.PATHSEG_ARC_REL*/ 11, + pathSegTypeAsLetter : "a" + }; }, /*SVGPathSegLinetoHorizontalAbs*/ createSVGPathSegLinetoHorizontalAbs: function(/*float*/ x ) { return { -- 2.11.0