From: dhrname Date: Fri, 31 Oct 2014 14:23:02 +0000 (+0900) Subject: SVGPathSegXXXインターフェースを排除し、オブジェクトリテラルをかわりに使う X-Git-Tag: version22~396^2~22 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0eceab013fecadf77d99cdac580c95c74761dd69;p=sie%2Fsie.git SVGPathSegXXXインターフェースを排除し、オブジェクトリテラルをかわりに使う --- 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 {