From: dhrname Date: Thu, 8 Nov 2012 14:22:46 +0000 (+0900) Subject: チケット #29787「paths-data-20-f.svgでArctoコマンドに不具合」修正 X-Git-Tag: v16beta~436 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7434d502e37da72eafcff7cff5b3d9bc07297824;p=sie%2Fsie.git チケット #29787「paths-data-20-f.svgでArctoコマンドに不具合」修正 --- diff --git a/org/w3c/dom/svg.js b/org/w3c/dom/svg.js index c163fc7..e5f3b33 100644 --- a/org/w3c/dom/svg.js +++ b/org/w3c/dom/svg.js @@ -2742,7 +2742,8 @@ _sproto._attrModi = function(evt){ isC = taco._isC, isL = taco._isL, tcc = tar.createSVGPathSegCurvetoCubicAbs, - tcll = tar.createSVGPathSegLinetoAbs; + tcll = tar.createSVGPathSegLinetoAbs, + flag, sflag; for (var i=0;i 1 && (+flag >= 0)) { /*if no commawsp*/ + di.splice(j+3, 1, flag.charAt(0), flag.slice(1)); + ++dili; + } + sflag = di[j+4]; + if (sflag.length > 1 && (+sflag >= 0)) { + di.splice(j+4, 1, sflag.charAt(0), sflag.slice(1)); + ++dili; + } + flag = di[j+3]; + sflag = di[j+4]; + if (((+flag < 0) || (+flag > 1)) || ((+sflag < 0) || (+sflag > 1))) { + /*仕様では、フラグが0か1しか認められていない*/ + j += 6; + continue; + } + s = tar.createSVGPathSegArcAbs(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +flag, +sflag); j += 6; } else if (dii === "m") { s = tar.createSVGPathSegMovetoRel(+di[j], +di[j+1]); @@ -2777,7 +2795,26 @@ _sproto._attrModi = function(evt){ s = tar.createSVGPathSegCurvetoQuadraticRel(+di[j+2], +di[j+3], +di[j], +di[j+1]); j += 3; } else if (dii === "a") { - s = tar.createSVGPathSegArcRel(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +di[j+3], +di[j+4]); + flag = di[j+3]; + if (flag.length > 1 && (+flag >= 0)) { /*if no commawsp*/ + di.splice(j+3, 1, flag.charAt(0), flag.slice(1)); + ++dili; + } + sflag = di[j+4]; + if (sflag.length > 1 && (+sflag >= 0)) { + console.log(di[j+5]+"," +di[j+6]+"," +di[j]+"," +di[j+1]+"," +di[j+2]+"," +di[j+3]+"," +di[j+4]); + di.splice(j+4, 1, sflag.charAt(0), sflag.slice(1)); + console.log(di[j+5]+"," +di[j+6]+"," +di[j]+"," +di[j+1]+"," +di[j+2]+"," +di[j+3]+"," +di[j+4]); + ++dili; + } + flag = di[j+3]; + sflag = di[j+4]; + if (((+flag < 0) || (+flag > 1)) || ((+sflag < 0) || (+sflag > 1))) { + /*仕様では、フラグが0か1しか認められていない*/ + j += 6; + continue; + } + s = tar.createSVGPathSegArcRel(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +flag, +sflag); j += 6; } else if (dii === "S") { s = tar.createSVGPathSegCurvetoCubicSmoothAbs(+di[j+2], +di[j+3], +di[j], +di[j+1]);