diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-06 22:28:20 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-06 22:28:20 +0100 |
commit | 3cb00000586340276998144d202d7af35c47ae36 (patch) | |
tree | 6b431cf16f05efeef63e145d1d1dc6aaceede4fb /src/viewbox.js | |
parent | 2702ceb26d3021720f3ff979bcf5f46fc65699e9 (diff) | |
download | svg.js-3cb00000586340276998144d202d7af35c47ae36.tar.gz svg.js-3cb00000586340276998144d202d7af35c47ae36.zip |
tab to space, block comments to line comments
Diffstat (limited to 'src/viewbox.js')
-rw-r--r-- | src/viewbox.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/viewbox.js b/src/viewbox.js index 11a7138..ce9c902 100644 --- a/src/viewbox.js +++ b/src/viewbox.js @@ -1,18 +1,18 @@ SVG.ViewBox = function(element) { var x, y, width, height - , wm = 1 /* width multiplier */ - , hm = 1 /* height multiplier */ + , wm = 1 // width multiplier + , hm = 1 // height multiplier , box = element.bbox() , view = (element.attr('viewBox') || '').match(/-?[\d\.]+/g) , we = element , he = element - /* get dimensions of current node */ + // get dimensions of current node width = new SVG.Number(element.width()) height = new SVG.Number(element.height()) - /* find nearest non-percentual dimensions */ + // find nearest non-percentual dimensions while (width.unit == '%') { wm *= width.value width = new SVG.Number(we instanceof SVG.Doc ? we.parent().offsetWidth : we.parent().width()) @@ -24,7 +24,7 @@ SVG.ViewBox = function(element) { he = he.parent() } - /* ensure defaults */ + // ensure defaults this.x = box.x this.y = box.y this.width = width * wm @@ -32,18 +32,18 @@ SVG.ViewBox = function(element) { this.zoom = 1 if (view) { - /* get width and height from viewbox */ + // get width and height from viewbox x = parseFloat(view[0]) y = parseFloat(view[1]) width = parseFloat(view[2]) height = parseFloat(view[3]) - /* calculate zoom accoring to viewbox */ + // calculate zoom accoring to viewbox this.zoom = ((this.width / this.height) > (width / height)) ? this.height / height : this.width / width - /* calculate real pixel dimensions on parent SVG.Doc element */ + // calculate real pixel dimensions on parent SVG.Doc element this.x = x this.y = y this.width = width |