diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-08 14:29:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 14:29:15 +0100 |
commit | 0534a6760a094d5a9425bde1d89bb8b71ae6a798 (patch) | |
tree | 2585c5ac4ec556626550499566cbcbefb68be24e /src/set.js | |
parent | 2fc62c55b889b0b533b17b2d4d9207f4b6c8b482 (diff) | |
download | svg.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.js | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -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 } } |