summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2016-11-02 23:56:03 -0400
committerRémi Tétreault <tetreault.remi@gmail.com>2016-11-08 02:00:33 -0500
commite3a9343891a11118e93e1a34c5ea49d65850fb6d (patch)
tree17479d28c4d0d09c68daf01fb5cd1c9f473c754e /spec
parent8b24eb02ded49b77f04cb7b5214c224569fc841b (diff)
downloadsvg.js-e3a9343891a11118e93e1a34c5ea49d65850fb6d.tar.gz
svg.js-e3a9343891a11118e93e1a34c5ea49d65850fb6d.zip
Fix a bug with the animation of a scale transform
Fix the bug where animating a scale transform also caused a translation when there was already a transform in place.
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/fx.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/spec/fx.js b/spec/spec/fx.js
index caf0644..182fe51 100644
--- a/spec/spec/fx.js
+++ b/spec/spec/fx.js
@@ -1533,4 +1533,21 @@ describe('FX', function() {
expect(called).toBe(true)
})
+ it('animate a scale transform without translating it when there is already a transform in place', function(){
+ var ctm
+
+ rect.scale(2) // The transform in place
+
+ fx.scale(0.5)
+ jasmine.clock().tick(500) // Have the animation reach its end
+ fx.step()
+
+ ctm = rect.ctm()
+ expect(ctm.a).toBe(0.5)
+ expect(ctm.b).toBe(0)
+ expect(ctm.c).toBe(0)
+ expect(ctm.d).toBe(0.5)
+ expect(ctm.e).toBe(75)
+ expect(ctm.f).toBe(75)
+ })
})