diff options
author | wout <wout@impinc.co.uk> | 2014-07-27 13:37:26 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-07-27 13:37:26 +0200 |
commit | 917cd24c50ce9ca2309febc7029f4408a1a5f0ee (patch) | |
tree | a9654cc9427c9ba8f9d9ea341dde8750b9991ee1 /spec | |
parent | a5b2301c23853cbd20b9e0771d11472dbef92cc6 (diff) | |
download | svg.js-917cd24c50ce9ca2309febc7029f4408a1a5f0ee.tar.gz svg.js-917cd24c50ce9ca2309febc7029f4408a1a5f0ee.zip |
Specified untransform() method
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/spec/element.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/spec/element.js b/spec/spec/element.js index 8864afa..176f656 100755 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -191,11 +191,30 @@ describe('Element', function() { }) }) + describe('untransform()', function() { + var circle + + beforeEach(function() { + circle = draw.circle(100).translate(50, 100) + }) + + it('removes the transform attribute', function() { + expect(circle.node.getAttribute('transform')).toBe('matrix(1,0,0,1,50,100)') + circle.untransform() + expect(circle.node.getAttribute('transform')).toBeNull() + }) + it('resets the current transform matix', function() { + expect(circle.ctm()).toEqual(new SVG.Matrix(1,0,0,1,50,100)) + circle.untransform() + expect(circle.ctm()).toEqual(new SVG.Matrix) + }) + }) + describe('ctm()', function() { var rect beforeEach(function() { - rect = draw.rect(100,100) + rect = draw.rect(100, 100) }) it('gets the current transform matrix of the element', function() { |