ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)
| リビジョン | 3710ee891f02b1bfb7f03c01c0cd00b8f9cae548 (tree) |
|---|---|
| 日時 | 2016-03-05 21:54:10 |
| 作者 | dhrname <dhrname@user...> |
| コミッター | dhrname |
Add the setAdd method and the setAccum method to the object
| @@ -1309,6 +1309,29 @@ base("$calcMode").up("$attribute").mix( { | ||
| 1309 | 1309 | whitesmoke: [245,245,245], |
| 1310 | 1310 | yellow: [255,255,0], |
| 1311 | 1311 | yellowgreen: [154,205,50] |
| 1312 | + }, | |
| 1313 | + | |
| 1314 | + setAdd: function (ele, to) { | |
| 1315 | + /*additive属性がsum (加法アニメーション)の場合*/ | |
| 1316 | + if (ele.getAttributeNS(null, "additive") === "sum") { | |
| 1317 | + var attrValue = ele.parentNode.getAttributeNS(null, this.attrName); | |
| 1318 | + ele.addEventListener("beginEvent", function(evt) { | |
| 1319 | + to.forEach( function(x) { | |
| 1320 | + x.to.setAdditive(attrValue); | |
| 1321 | + } ) | |
| 1322 | + }, false); | |
| 1323 | + } | |
| 1324 | + }, | |
| 1325 | + setAccum: function (ele, to) { | |
| 1326 | + /*accumulate属性がsum (蓄積アニメーション)の場合*/ | |
| 1327 | + if (ele.getAttributeNS(null, "accumulate") === "sum") { | |
| 1328 | + ele.addEventListener("repeatEvent", function(evt) { | |
| 1329 | + to.forEach( function(x) { | |
| 1330 | + x.to.call(); | |
| 1331 | + x.to.setAccumulate(evt.detail); | |
| 1332 | + } ) | |
| 1333 | + }, false); | |
| 1334 | + } | |
| 1312 | 1335 | } |
| 1313 | 1336 | |
| 1314 | 1337 | /*initメソッドに追加処理 |
| @@ -1381,25 +1404,8 @@ base("$calcMode").up("$attribute").mix( { | ||
| 1381 | 1404 | return (this.mode !== "spline") |
| 1382 | 1405 | || (s(0.1) !== Math.PI); |
| 1383 | 1406 | }, this ); |
| 1384 | - | |
| 1385 | - /*additive属性がsum (加法アニメーション)の場合*/ | |
| 1386 | - if (ele.getAttributeNS(null, "additive") === "sum") { | |
| 1387 | - var attrValue = ele.parentNode.getAttributeNS(null, this.attrName); | |
| 1388 | - ele.addEventListener("beginEvent", function(evt) { | |
| 1389 | - to.forEach( function(x) { | |
| 1390 | - x.to.setAdditive(attrValue); | |
| 1391 | - } ) | |
| 1392 | - }, false); | |
| 1393 | - } | |
| 1394 | - /*acuumulate属性がsum (蓄積アニメーション)の場合*/ | |
| 1395 | - if (ele.getAttributeNS(null, "accumulate") === "sum") { | |
| 1396 | - ele.addEventListener("repeatEvent", function(evt) { | |
| 1397 | - to.forEach( function(x) { | |
| 1398 | - x.to.call(); | |
| 1399 | - x.to.setAccumulate(evt.detail); | |
| 1400 | - } ) | |
| 1401 | - }, false); | |
| 1402 | - } | |
| 1407 | + this.setAdd(ele, to); | |
| 1408 | + this.setAccum(ele, to); | |
| 1403 | 1409 | } |
| 1404 | 1410 | keywords = toRGB = isColor = void 0; |
| 1405 | 1411 | } ) |