aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-10-22 17:20:45 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-10-22 17:20:45 +0200
commit0b5b0eb4842c0bad045a69981d00cba7010f8d31 (patch)
tree44589fb7ff91d134c7e10b3e46f2242623e1484c /src
parent8617a6b5d5ff147718051a7fc582c54f603aa90f (diff)
downloadsvg.js-0b5b0eb4842c0bad045a69981d00cba7010f8d31.tar.gz
svg.js-0b5b0eb4842c0bad045a69981d00cba7010f8d31.zip
bbox loop (fix #392)
Diffstat (limited to 'src')
-rw-r--r--src/boxes.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/boxes.js b/src/boxes.js
index 2595f25..eca32ec 100644
--- a/src/boxes.js
+++ b/src/boxes.js
@@ -10,13 +10,11 @@ SVG.BBox = SVG.invent({
// find native bbox
box = element.node.getBBox()
} catch(e) {
- try{
- // clone element to visible place to get bbox (FF fix)
+ if(element instanceof SVG.Shape){
var clone = element.clone().addTo(SVG.parser.draw)
box = clone.bbox()
clone.remove()
- } catch(e) {
- // mimic bbox
+ }else{
box = {
x: element.node.clientLeft
, y: element.node.clientTop