summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-08-29 12:45:21 +0200
committerwout <wout@impinc.co.uk>2014-08-29 12:45:21 +0200
commitdd4be62e397e4db78444881eed32865f98e52582 (patch)
treec2300f62c756fde22c80f30aba66dca04602297b /spec
parent8789391f036ffded3ac919d62ee652e7cae15c5c (diff)
downloadsvg.js-dd4be62e397e4db78444881eed32865f98e52582.tar.gz
svg.js-dd4be62e397e4db78444881eed32865f98e52582.zip
Added SVG.TBox for transformed bounding boxes
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/circle.js4
-rwxr-xr-xspec/spec/ellipse.js4
-rwxr-xr-xspec/spec/group.js14
-rwxr-xr-xspec/spec/image.js4
-rwxr-xr-xspec/spec/line.js8
-rw-r--r--spec/spec/matrix.js6
-rwxr-xr-xspec/spec/path.js8
-rwxr-xr-xspec/spec/polygon.js8
-rwxr-xr-xspec/spec/polyline.js8
-rwxr-xr-xspec/spec/rect.js4
10 files changed, 34 insertions, 34 deletions
diff --git a/spec/spec/circle.js b/spec/spec/circle.js
index e41e7cf..be64e27 100644
--- a/spec/spec/circle.js
+++ b/spec/spec/circle.js
@@ -154,13 +154,13 @@ describe('Circle', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box = circle.scale(2).bbox()
+ var box = circle.scale(2).tbox()
expect(box.width).toBe(circle.attr('r') * 2 * 2)
expect(box.height).toBe(circle.attr('r') * 2 * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box = circle.scale(2, 3.5).bbox()
+ var box = circle.scale(2, 3.5).tbox()
expect(box.width).toBe(circle.attr('r') * 2 * 2)
expect(box.height).toBe(circle.attr('r') * 2 * 3.5)
diff --git a/spec/spec/ellipse.js b/spec/spec/ellipse.js
index 190b616..027802c 100755
--- a/spec/spec/ellipse.js
+++ b/spec/spec/ellipse.js
@@ -156,13 +156,13 @@ describe('Ellipse', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box = ellipse.scale(2).bbox()
+ var box = ellipse.scale(2).tbox()
expect(box.width).toBe(ellipse.attr('rx') * 2 * 2)
expect(box.height).toBe(ellipse.attr('ry') * 2 * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box = ellipse.scale(2, 3.5).bbox()
+ var box = ellipse.scale(2, 3.5).tbox()
expect(box.width).toBe(ellipse.attr('rx') * 2 * 2)
expect(box.height).toBe(ellipse.attr('ry') * 2 * 3.5)
diff --git a/spec/spec/group.js b/spec/spec/group.js
index 4aed57b..3187a3f 100755
--- a/spec/spec/group.js
+++ b/spec/spec/group.js
@@ -16,12 +16,12 @@ describe('Group', function() {
})
it('sets the value of x with the first argument', function() {
group.x(123)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.x).toBe(123)
})
it('sets the value of x correctly when called multiple times', function() {
group.x(10).x(100).x(13)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.x).toBe(13)
})
})
@@ -32,12 +32,12 @@ describe('Group', function() {
})
it('sets the value of y with the first argument', function() {
group.y(345)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.y).toBe(345)
})
it('sets the value of y correctly when called multiple times', function() {
group.y(1).y(10).y(15)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.y).toBe(15)
})
})
@@ -48,7 +48,7 @@ describe('Group', function() {
})
it('sets the value of cx with the first argument', function() {
group.cx(123)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.cx).toBe(123)
})
})
@@ -59,7 +59,7 @@ describe('Group', function() {
})
it('sets the value of cy with the first argument', function() {
group.cy(345)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.cy).toBe(345)
})
})
@@ -74,7 +74,7 @@ describe('Group', function() {
describe('center()', function() {
it('sets the cx and cy position', function() {
group.center(321,567)
- var box = group.bbox()
+ var box = group.tbox()
expect(box.cx).toBe(321)
expect(box.cy).toBe(567)
})
diff --git a/spec/spec/image.js b/spec/spec/image.js
index e3efcc2..a764265 100755
--- a/spec/spec/image.js
+++ b/spec/spec/image.js
@@ -137,13 +137,13 @@ describe('Image', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box = image.scale(2).bbox()
+ var box = image.scale(2).tbox()
expect(box.width).toBe(image.attr('width') * 2)
expect(box.height).toBe(image.attr('height') * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box = image.scale(2, 3.5).bbox()
+ var box = image.scale(2, 3.5).tbox()
expect(box.width).toBe(image.attr('width') * 2)
expect(box.height).toBe(image.attr('height') * 3.5)
diff --git a/spec/spec/line.js b/spec/spec/line.js
index fdea31f..8e19014 100755
--- a/spec/spec/line.js
+++ b/spec/spec/line.js
@@ -164,15 +164,15 @@ describe('Line', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box1 = line.bbox()
- , box2 = line.scale(2).bbox()
+ var box1 = line.tbox()
+ , box2 = line.scale(2).tbox()
expect(box2.width).toBe(box1.width * 2)
expect(box2.height).toBe(box1.height * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box1 = line.bbox()
- , box2 = line.scale(2,3.5).bbox()
+ var box1 = line.tbox()
+ , box2 = line.scale(2,3.5).tbox()
expect(box2.width).toBe(box1.width * 2)
expect(box2.height).toBe(box1.height * 3.5)
diff --git a/spec/spec/matrix.js b/spec/spec/matrix.js
index e2da36e..281cdb3 100644
--- a/spec/spec/matrix.js
+++ b/spec/spec/matrix.js
@@ -67,13 +67,13 @@ describe('Matrix', function() {
matrix = new SVG.Matrix(rect)
})
- it('parses the current transform matrix form an element', function() {
+ it('parses the current transform matrix from an element', function() {
expect(matrix.a).toBeCloseTo(1.9696155786514282)
expect(matrix.b).toBeCloseTo(-0.3472963869571686)
expect(matrix.c).toBeCloseTo(0.3472963869571686)
expect(matrix.d).toBeCloseTo(1.9696155786514282)
- expect(matrix.e).toBeCloseTo(-66.2967529296875)
- expect(matrix.f).toBeCloseTo(-32.799678802490234)
+ expect(matrix.e).toBeCloseTo(-17.770875930786133)
+ expect(matrix.f).toBeCloseTo(11.178505897521973)
})
describe('extract()', function() {
diff --git a/spec/spec/path.js b/spec/spec/path.js
index a4d039e..b333002 100755
--- a/spec/spec/path.js
+++ b/spec/spec/path.js
@@ -161,15 +161,15 @@ describe('Path', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box1 = path.bbox()
- , box2 = path.scale(2).bbox()
+ var box1 = path.tbox()
+ , box2 = path.scale(2).tbox()
expect(box1.width * 2).toBe(box2.width)
expect(box1.height * 2).toBe(box2.height)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box1 = path.bbox()
- , box2 = path.scale(2, 3.5).bbox()
+ var box1 = path.tbox()
+ , box2 = path.scale(2, 3.5).tbox()
expect(box1.width * 2).toBe(box2.width)
expect(box1.height * 3.5).toBe(box2.height)
diff --git a/spec/spec/polygon.js b/spec/spec/polygon.js
index af9030b..b6dc40d 100755
--- a/spec/spec/polygon.js
+++ b/spec/spec/polygon.js
@@ -155,15 +155,15 @@ describe('Polygon', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box1 = polygon.bbox()
- , box2 = polygon.scale(2).bbox()
+ var box1 = polygon.tbox()
+ , box2 = polygon.scale(2).tbox()
expect(box2.width).toBe(box1.width * 2)
expect(box2.height).toBe(box1.height * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box1 = polygon.bbox()
- , box2 = polygon.scale(2, 3.5).bbox()
+ var box1 = polygon.tbox()
+ , box2 = polygon.scale(2, 3.5).tbox()
expect(box2.width).toBe(box1.width * 2)
expect(box2.height).toBe(box1.height * 3.5)
diff --git a/spec/spec/polyline.js b/spec/spec/polyline.js
index b9c3c1f..eeb761f 100755
--- a/spec/spec/polyline.js
+++ b/spec/spec/polyline.js
@@ -155,15 +155,15 @@ describe('Polyline', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box1 = polyline.bbox()
- , box2 = polyline.scale(2).bbox()
+ var box1 = polyline.tbox()
+ , box2 = polyline.scale(2).tbox()
expect(box2.width).toBe(box1.width * 2)
expect(box2.height).toBe(box1.height * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box1 = polyline.bbox()
- , box2 = polyline.scale(2, 3.5).bbox()
+ var box1 = polyline.tbox()
+ , box2 = polyline.scale(2, 3.5).tbox()
expect(box2.width).toBe(box1.width * 2)
expect(box2.height).toBe(box1.height * 3.5)
diff --git a/spec/spec/rect.js b/spec/spec/rect.js
index f983d78..cd82d39 100755
--- a/spec/spec/rect.js
+++ b/spec/spec/rect.js
@@ -150,13 +150,13 @@ describe('Rect', function() {
describe('scale()', function() {
it('should scale the element universally with one argument', function() {
- var box = rect.scale(2).bbox()
+ var box = rect.scale(2).tbox()
expect(box.width).toBe(rect.attr('width') * 2)
expect(box.height).toBe(rect.attr('height') * 2)
})
it('should scale the element over individual x and y axes with two arguments', function() {
- var box = rect.scale(2, 3.5).bbox()
+ var box = rect.scale(2, 3.5).tbox()
expect(box.width).toBe(rect.attr('width') * 2)
expect(box.height).toBe(rect.attr('height') * 3.5)