summaryrefslogtreecommitdiffstats
path: root/dist/svg.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-02-20 20:35:59 +0100
committerwout <wout@impinc.co.uk>2013-02-20 20:35:59 +0100
commit7529b965182e3bd950dd86557defb90daf075cde (patch)
treec0dd845ff544be5fc4edf25abc82aacaa5d4ec43 /dist/svg.js
parent1e183700e2582271256a279ac3e8843037e0f713 (diff)
downloadsvg.js-7529b965182e3bd950dd86557defb90daf075cde.tar.gz
svg.js-7529b965182e3bd950dd86557defb90daf075cde.zip
Defaulting zoom in viewbox to 1
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) {