diff options
author | dotnetCarpenter <jon.ronnenberg@gmail.com> | 2017-02-24 16:26:15 +0100 |
---|---|---|
committer | dotnetCarpenter <jon.ronnenberg@gmail.com> | 2017-02-24 16:26:15 +0100 |
commit | 0a0bb10bc3c8edf6c42b61bd03084925d7f63b7b (patch) | |
tree | edc13b2abf7cca6b72f3fee51986fd1f8e9ff8da /spec | |
parent | 82da55b56eb2d663db9a5dd6ecfeb79cb7d6f274 (diff) | |
download | svg.js-0a0bb10bc3c8edf6c42b61bd03084925d7f63b7b.tar.gz svg.js-0a0bb10bc3c8edf6c42b61bd03084925d7f63b7b.zip |
slim down the SVG.TBox to SVG.RBox mapping (new SVG.TBox will not work)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/boxes.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/spec/boxes.js b/spec/spec/boxes.js index 87ec279..47a9d9e 100644 --- a/spec/spec/boxes.js +++ b/spec/spec/boxes.js @@ -42,6 +42,32 @@ describe('BBox', function() { }) +describe('TBox', function() { + + afterEach(function() { + draw.clear() + }) + + it('should map to RBox and be removed in 3.x', function() { + var rect = draw.rect(100, 100).move(100, 25) + var tbox = rect.tbox() + + expect(tbox.x).toBe(100) + expect(tbox.y).toBe(25) + + rect.transform({ scale: 1.5 }) + tbox = rect.tbox() + expect(tbox.x).toBe(75) + expect(tbox.y).toBe(0) + + rect.transform({ skewX: 5 }) + tbox = rect.tbox() + expect(tbox.x|0).toBe(68) + expect(tbox.y|0).toBe(0) + }) + +}) + describe('RBox', function() { afterEach(function() { |