aboutsummaryrefslogtreecommitdiffstats
path: root/src/viewbox.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/viewbox.js')
-rw-r--r--src/viewbox.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/viewbox.js b/src/viewbox.js
index ff84b93..128c4cd 100644
--- a/src/viewbox.js
+++ b/src/viewbox.js
@@ -7,8 +7,8 @@ SVG.ViewBox = function(element) {
/* clone attributes */
this.x = box.x
this.y = box.y
- this.width = element.node.offsetWidth || element.attr('width')
- this.height = element.node.offsetHeight || element.attr('height')
+ this.width = element.node.getBoundingClientRect().width
+ this.height = element.node.getBoundingClientRect().height
if (view) {
/* get width and height from viewbox */