diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-23 15:06:37 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-23 15:06:37 +0100 |
commit | 8555e13b252f07f8079b08c0b29f4399d389b1e0 (patch) | |
tree | 98dd44791b3a28a68ab11e90d1c2da7bc069ea21 /dirty.html | |
parent | d5c01a7848154d240f434b38d802fdb65727fd7f (diff) | |
download | svg.js-8555e13b252f07f8079b08c0b29f4399d389b1e0.tar.gz svg.js-8555e13b252f07f8079b08c0b29f4399d389b1e0.zip |
fixed lots of bugs in the timeline. Its now working as expected in all cases.
- refactor code into functions
- handle timeSource correctly
- allow for immediate updates
- Runners dont know about their delay anymore. Thats far more simple.
- Timeline is paused on creation
Diffstat (limited to 'dirty.html')
-rw-r--r-- | dirty.html | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -145,6 +145,8 @@ schedule.forEach((s, i) => { // s.runner.during(console.log) }) +// t.play() + var mover = canvas.line(100, 100, 100, 300).attr('stroke', 'black') mover.clone().insertAfter(mover) canvas.line(100, 300, 800, 300).attr('stroke', 'black') @@ -202,6 +204,13 @@ SVG('button[name="reverse"]').on('click', () => { }) +canvas.rect(100, 100).on('click', (e) => { + e.target.instance.animate().move(Math.random()*1000, Math.random()*750).timeline().on('finished', () => { + console.log('rect finished') + }) +}) + + console.log(schedule) // var bla = SVG('<rect>').size(0, 0).move(200, 200).addTo('svg') |