ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)
| リビジョン | 82e3e2ccd7637c981622763e2cd68a55e614a065 (tree) |
|---|---|
| 日時 | 2015-12-02 22:25:13 |
| 作者 | dhrname <dhrname@user...> |
| コミッター | dhrname |
Modify the additive attribute's problem
| @@ -534,7 +534,11 @@ base("$from").of( { | ||
| 534 | 534 | |
| 535 | 535 | /*$toオブジェクトにこのオブジェクトを適用させる関数*/ |
| 536 | 536 | call: function() { |
| 537 | - if (this.numList.length) { | |
| 537 | + if (this.numList.length | |
| 538 | + && (this.additive[0] === 0) | |
| 539 | + && (this.accumulate[0] === 0) | |
| 540 | + ) { | |
| 541 | + /*配列の項目がundefinedだと困るので、配列を初期化する*/ | |
| 538 | 542 | var additive = [], |
| 539 | 543 | accumulate = []; |
| 540 | 544 | for (var i=0;i<this.numList.length;++i) { |
| @@ -633,9 +637,7 @@ base("$from").of( { | ||
| 633 | 637 | } |
| 634 | 638 | var from = this.$from.up(); |
| 635 | 639 | from.string = str; |
| 636 | - var s = from.call(); | |
| 637 | - this.additive = s; | |
| 638 | - return s; | |
| 640 | + return ( this.additive = from.call() ); | |
| 639 | 641 | }, |
| 640 | 642 | |
| 641 | 643 | /*setAccumulate メソッド |
| @@ -645,11 +647,9 @@ base("$from").of( { | ||
| 645 | 647 | if (!num || isNaN(num)) { |
| 646 | 648 | return 0; |
| 647 | 649 | } |
| 648 | - var s = this.numList.map( function(d) { | |
| 650 | + return ( this.accumulate = this.numList.map( function(d) { | |
| 649 | 651 | return d * num; |
| 650 | - } ); | |
| 651 | - this.accumulate = s; | |
| 652 | - return s; | |
| 652 | + } ) ); | |
| 653 | 653 | } |
| 654 | 654 | } ) |
| 655 | 655 | /*fromプロパティの初期化*/ |