Rémi Tétreault [Fri, 17 Feb 2017 01:35:05 +0000 (20:35 -0500)]
Sort out leftovers from the old fx module
This commit is mostly to clean up the implementation of the initAnimation
method of the Fx Module (issue #547). It also fixes these issues: #552, #582
and #584.
Here is a list of the changes and fixes that are made:
* Add a plot and array method to SVG.TextPath (issue #582)
* Make the method plot a getter when no parameter is passed for SVG.Polyline,
SVG.Polygon, SVG.Line, SVG.Path (this idea come from issue #547)
* Allow SVG.PointArray to be passed flat array
* Change the regexp SVG.PointArray use to parse string to allow more
flexibility in the way spaces and commas can be used to separate points
(something like this is now accepted: '1, 2, 3, 4')
* Allow plot to be called with 4 parameters when animating an SVG.Line
* Fix a bug in the plain morphing part of SVG.MorphObj that is in the FX module
* Relative value for SVG.Number are now calculated in its morph method (idea
from issue #547)
* Clean up the implementation of the initAnimation method of the FX module
(issues #547, #552, #584)
From "change from SVG() to use querySelector instead of getElementById (breaking change) -> __TODO!__" to "change SVG() to use querySelector instead of getElementById (breaking change) -> __TODO!__"
Rémi Tétreault [Wed, 21 Dec 2016 02:33:18 +0000 (21:33 -0500)]
Implement a more basic morph method for SVG.PathArray
The method expect the paths to use the exact same commands. It will not
attempt to modify them if they do not. Any more complex algorithm shall be
provided as a plugin instead in order to keep the size of the library down.
Rémi Tétreault [Wed, 21 Dec 2016 02:33:18 +0000 (21:33 -0500)]
Implement a more basic morph method for SVG.PathArray
The method expect the paths to use the exact same commands. It will not
attempt to modify them if they do not. Any more complex algorithm shall be
provided as a plugin instead in order to keep the size of the library down.
Rémi Tétreault [Sun, 30 Oct 2016 19:20:25 +0000 (15:20 -0400)]
Fix and improve the dequeue method of the FX module
The first improvement is to stop using setTimeout to perform the delay. It is
now performed in a manner similar to the start method. This should be a lot
more reliable than using setTimeout and allow some nice goodies like
being able to pause it or affect its duration using the speed method.
The second improvement is to have the delay method add an empty situation
(with its duration set to the duration of the delay) to the queue. This change
allows dequeue not to have to treat delay added to the queue as something
special, now its just a situation.
Rémi Tétreault [Thu, 20 Oct 2016 05:04:12 +0000 (01:04 -0400)]
Make the code in the FX module simpler
Here are the changes that have been made:
- The loop counter is now incrementing (from 0 to loops)
- The loop counter increment even when loops is true
- Add absPos, the absolute position of an animation which is its position in
the context of its complete duration (including delay and loops)
- Make the methods speed, pause/resume affect the delay
- The method step no longer needs to recalculate the value of situation.start
- Add a second parameter to the method at to allow it to receive an absolute
position
- Fix the bug where the method at invert the passed position while the
animation is running backward
Also, I modified the tests of the FX module that required timing to use
Jasmine Clock, so now it takes less than 1 second to run all the tests!
Rémi Tétreault [Tue, 1 Nov 2016 21:23:06 +0000 (17:23 -0400)]
Make matrixify work with transformation chain separated by commas
According to the SVG spec, transformation chain can be separated by whitespace
and/or commas. The method matrixify was not working with transformation chain
separated by commas. This commit should fix that bug.
Rémi Tétreault [Mon, 17 Oct 2016 00:21:48 +0000 (20:21 -0400)]
Make SVG.FX.speed act more like others animations libraries
For example, a call .speed(2) would make the animation 2 times faster.
If you then call .speed(4), this would make the animation 4 times faster.
And a call .speed(1) would make it go back to normal speed.