aboutsummaryrefslogtreecommitdiffstats
path: root/src/set.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-08 14:29:15 +0100
committerGitHub <noreply@github.com>2017-03-08 14:29:15 +0100
commit0534a6760a094d5a9425bde1d89bb8b71ae6a798 (patch)
tree2585c5ac4ec556626550499566cbcbefb68be24e /src/set.js
parent2fc62c55b889b0b533b17b2d4d9207f4b6c8b482 (diff)
downloadsvg.js-0534a6760a094d5a9425bde1d89bb8b71ae6a798.tar.gz
svg.js-0534a6760a094d5a9425bde1d89bb8b71ae6a798.zip
added SVG.Box, added transform method to boxes, fix rbox (#626)
added SVG.Box, added transform method to boxes, fix rbox Also: - workaround for screenCTM with nested svg (FF bug) - remove unneeded workaround in toParent() - rbox accepts additional parameter to transform the box
Diffstat (limited to 'src/set.js')
-rw-r--r--src/set.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/set.js b/src/set.js
index 41289dd..9da52c7 100644
--- a/src/set.js
+++ b/src/set.js
@@ -70,25 +70,19 @@ SVG.Set = SVG.invent({
}
// Get the bounding box of all members included or empty box if set has no items
, bbox: function(){
- var box = new SVG.BBox()
-
// return an empty box of there are no members
if (this.members.length == 0)
- return box
+ return new SVG.RBox()
// get the first rbox and update the target bbox
- var rbox = this.members[0].rbox()
- box.x = rbox.x
- box.y = rbox.y
- box.width = rbox.width
- box.height = rbox.height
+ var rbox = this.members[0].rbox(this.members[0].doc())
this.each(function() {
// user rbox for correct position and visual representation
- box = box.merge(this.rbox())
+ rbox = rbox.merge(this.rbox(this.doc()))
})
- return box
+ return rbox
}
}