aboutsummaryrefslogtreecommitdiffstats
path: root/dist/svg.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-02-03 21:59:15 +0100
committerwout <wout@impinc.co.uk>2014-02-03 21:59:15 +0100
commit189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6 (patch)
tree39728b3425c7906b772a84d46778d33e34770ddf /dist/svg.js
parent8dcb37d3406a85ef639e31b256823cf24fd7b7c6 (diff)
downloadsvg.js-189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6.tar.gz
svg.js-189f009dbb28525f3eb2c0bb7a72312cb6fe4ba6.zip
Added second values to SVG.Number
Diffstat (limited to 'dist/svg.js')
-rw-r--r--dist/svg.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/dist/svg.js b/dist/svg.js
index 0ae4acd..a9a28a4 100644
--- a/dist/svg.js
+++ b/dist/svg.js
@@ -1,4 +1,4 @@
-/* svg.js v1.0rc3-2-g78bbbfe - svg inventor regex default color array pointarray patharray number viewbox bbox rbox element parent container fx relative event defs group arrange mask clip gradient doc shape use rect ellipse line poly path image text textpath nested hyperlink sugar set data memory loader - svgjs.com/license */
+/* svg.js v1.0rc3-3-g8dcb37d - svg inventor regex default color array pointarray patharray number viewbox bbox rbox element parent container fx relative event defs group arrange mask clip gradient doc shape use rect ellipse line poly path image text textpath nested hyperlink sugar set data memory loader - svgjs.com/license */
;(function() {
this.SVG = function(element) {
@@ -804,6 +804,8 @@
/* normalize percent value */
if (match[2] == '%')
this.value /= 100
+ else if (match[2] == 's')
+ this.value *= 1000
/* store unit */
this.unit = match[2]
@@ -822,7 +824,13 @@
SVG.extend(SVG.Number, {
// Stringalize
toString: function() {
- return (this.unit == '%' ? ~~(this.value * 1e8) / 1e6 : this.value) + this.unit
+ return (
+ this.unit == '%' ?
+ ~~(this.value * 1e8) / 1e6:
+ this.unit == 's' ?
+ this.value / 1e3 :
+ this.value
+ ) + this.unit
}
, // Convert to primitive
valueOf: function() {
@@ -1647,7 +1655,7 @@
}
/* ensure default duration and easing */
- d = d == null ? 1000 : d
+ d = d == null ? 1000 : new SVG.Number(d).valueOf()
ease = ease || '<>'
/* process values */