aboutsummaryrefslogtreecommitdiffstats
path: root/dist/svg.js
diff options
context:
space:
mode:
Diffstat (limited to 'dist/svg.js')
-rw-r--r--dist/svg.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/dist/svg.js b/dist/svg.js
index f291a1b..f131d4f 100644
--- a/dist/svg.js
+++ b/dist/svg.js
@@ -1,4 +1,4 @@
-/* svg.js v0.6-6-gb2ac141 - svg viewbox bbox element container fx event group arrange defs mask pattern gradient doc shape wrap rect ellipse line poly path image text nested sugar - svgjs.com/license */
+/* svg.js v0.6-7-g1e18370 - svg viewbox bbox element container fx event group arrange defs mask pattern gradient doc shape wrap rect ellipse line poly path image text nested sugar - svgjs.com/license */
(function() {
this.svg = function(element) {
@@ -43,9 +43,8 @@
/* clone attributes */
this.x = box.x
this.y = box.y
- this.width = element.node.offsetWidth
- this.height = element.node.offsetHeight
- this.zoom = 1
+ this.width = element.node.offsetWidth || element.attr('width')
+ this.height = element.node.offsetHeight || element.attr('height')
if (view) {
/* get width and height from viewbox */
@@ -60,13 +59,15 @@
this.width / width
/* calculate real pixel dimensions on parent SVG.Doc element */
- if (element instanceof SVG.Doc) {
- this.x = x
- this.y = y
- this.width = width
- this.height = height
- }
+ this.x = x
+ this.y = y
+ this.width = width
+ this.height = height
}
+
+ /* ensure a default zoom value */
+ this.zoom = this.zoom || 1
+
}
SVG.BBox = function(element) {