summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authordotnetCarpenter <jon.ronnenberg@gmail.com>2017-02-24 16:26:15 +0100
committerdotnetCarpenter <jon.ronnenberg@gmail.com>2017-02-24 16:26:15 +0100
commit0a0bb10bc3c8edf6c42b61bd03084925d7f63b7b (patch)
treeedc13b2abf7cca6b72f3fee51986fd1f8e9ff8da /spec
parent82da55b56eb2d663db9a5dd6ecfeb79cb7d6f274 (diff)
downloadsvg.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.js26
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() {