From e3a9343891a11118e93e1a34c5ea49d65850fb6d Mon Sep 17 00:00:00 2001 From: Rémi Tétreault Date: Wed, 2 Nov 2016 23:56:03 -0400 Subject: 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. --- spec/spec/fx.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'spec') 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) + }) }) -- cgit v1.2.3