From ec833bcefe20bd51d128cd0978128a9c9a63a043 Mon Sep 17 00:00:00 2001 From: wout Date: Thu, 11 Apr 2013 08:52:20 +0100 Subject: Fix for Firefox in bbox() --- src/bbox.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3