summaryrefslogtreecommitdiffstats
path: root/dist/svg.js
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2017-02-25 13:23:23 -0500
committerRémi Tétreault <tetreault.remi@gmail.com>2017-02-25 16:59:55 -0500
commit6327512f1afe304891f5fb5e59afc15e55d70ba1 (patch)
tree8a0e8c2acb5e421c76ef6686ce9feeccdebe4779 /dist/svg.js
parentef7451dd477e1835d92f3de493029225fa55d603 (diff)
downloadsvg.js-6327512f1afe304891f5fb5e59afc15e55d70ba1.tar.gz
svg.js-6327512f1afe304891f5fb5e59afc15e55d70ba1.zip
Add tests for the method atEnd of the FX module
List of changes: * Add tests for atEnd for the case the animation is in a infinite loop * Fix a bug in atEnd that was uncovered by the new tests * Fix the indentation of the methods atStart and atEnd * Improve the comments of some of the others tests of atEnd
Diffstat (limited to 'dist/svg.js')
-rw-r--r--dist/svg.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/dist/svg.js b/dist/svg.js
index ff71f85..0a5ff48 100644
--- a/dist/svg.js
+++ b/dist/svg.js
@@ -6,7 +6,7 @@
* @copyright Wout Fierens <wout@mick-wout.com>
* @license MIT
*
-* BUILT: Sat Feb 25 2017 15:05:15 GMT+0100 (Mitteleuropäische Zeit)
+* BUILT: Sat Feb 25 2017 16:58:49 GMT-0500 (EST)
*/;
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
@@ -1594,22 +1594,24 @@ SVG.FX = SVG.invent({
// set the internal animation pointer at the start position, before any loops, and updates the visualisation
, atStart: function() {
- return this.at(0, true)
- }
+ return this.at(0, true)
+ }
// set the internal animation pointer at the end position, after all the loops, and updates the visualisation
, atEnd: function() {
- if (this.situation.loops === true) {
- // If in a infinite loop, we end the current iteration
- return this.at(this.situation.loop+1, true)
- } else if(typeof this.situation.loops == 'number') {
- // If performing a finite number of loops, we go after all the loops
- return this.at(this.situation.loops, true)
- } else {
- // If no loops, we just go at the end
- return this.at(1, true)
+ if (this.situation.loops === true) {
+ // If in a infinite loop, we end the current iteration
+ this.situation.loops = this.situation.loop + 1
+ }
+
+ if(typeof this.situation.loops == 'number') {
+ // If performing a finite number of loops, we go after all the loops
+ return this.at(this.situation.loops, true)
+ } else {
+ // If no loops, we just go at the end
+ return this.at(1, true)
+ }
}
- }
// set the internal animation pointer to the specified position and updates the visualisation
// if isAbsPos is true, pos is treated as an absolute position