aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-04-11 08:52:20 +0100
committerwout <wout@impinc.co.uk>2013-04-11 08:52:20 +0100
commitec833bcefe20bd51d128cd0978128a9c9a63a043 (patch)
tree2369300640e2bc4317bea0ca3b3849b3bb6b0871 /src
parent0ec7b9bf96cdd3ad2aa72682d3781c0aa1c7c356 (diff)
downloadsvg.js-ec833bcefe20bd51d128cd0978128a9c9a63a043.tar.gz
svg.js-ec833bcefe20bd51d128cd0978128a9c9a63a043.zip
Fix for Firefox in bbox()0.13
Diffstat (limited to 'src')
-rw-r--r--src/bbox.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bbox.js b/src/bbox.js
index ee101b2..22c5bcf 100644
--- a/src/bbox.js
+++ b/src/bbox.js
@@ -1,15 +1,16 @@
SVG.BBox = function(element) {
- /* actual, native bounding box */
var box
+
+ /* actual, native bounding box */
try {
box = element.node.getBBox()
- } catch(err) {
+ } catch(e) {
box = {
- x: element.node.clientLeft,
- y: element.node.clientTop,
- width: element.node.clientWidth,
- height: element.node.clientHeight
+ x: element.node.clientLeft
+ , y: element.node.clientTop
+ , width: element.node.clientWidth
+ , height: element.node.clientHeight
}
}
@@ -18,7 +19,7 @@ SVG.BBox = function(element) {
this.y = box.y + element.trans.y
/* plain width and height */
- this.width = box.width * element.trans.scaleX
+ this.width = box.width * element.trans.scaleX
this.height = box.height * element.trans.scaleY
/* add the center */