summaryrefslogtreecommitdiffstats
path: root/src/boxes.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-10-11 21:55:58 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-10-11 21:55:58 +0200
commit8617a6b5d5ff147718051a7fc582c54f603aa90f (patch)
treeca846f068683b23efe2b38b1b4dab0be6ec789e9 /src/boxes.js
parentebf3dc52374159ebb64663a842f5704237934401 (diff)
downloadsvg.js-8617a6b5d5ff147718051a7fc582c54f603aa90f.tar.gz
svg.js-8617a6b5d5ff147718051a7fc582c54f603aa90f.zip
fixed mask animation in Firefox (#287)
Diffstat (limited to 'src/boxes.js')
-rw-r--r--src/boxes.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/boxes.js b/src/boxes.js
index 9d214e3..2595f25 100644
--- a/src/boxes.js
+++ b/src/boxes.js
@@ -10,12 +10,19 @@ SVG.BBox = SVG.invent({
// find native bbox
box = element.node.getBBox()
} catch(e) {
- // mimic bbox
- box = {
- x: element.node.clientLeft
- , y: element.node.clientTop
- , width: element.node.clientWidth
- , height: element.node.clientHeight
+ try{
+ // clone element to visible place to get bbox (FF fix)
+ var clone = element.clone().addTo(SVG.parser.draw)
+ box = clone.bbox()
+ clone.remove()
+ } catch(e) {
+ // mimic bbox
+ box = {
+ x: element.node.clientLeft
+ , y: element.node.clientTop
+ , width: element.node.clientWidth
+ , height: element.node.clientHeight
+ }
}
}