summaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2019-01-13 20:39:11 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2019-01-13 20:39:11 +0100
commit8802d25609c26eaa5372662615929fca95a906f9 (patch)
tree50755a96e66b666b9ffad09b8f5f47baa6fab43f /src/types
parentb1c31462b498ee50e8ed3a88b07ad4a302431d32 (diff)
downloadsvg.js-8802d25609c26eaa5372662615929fca95a906f9.tar.gz
svg.js-8802d25609c26eaa5372662615929fca95a906f9.zip
added back `to()` as `unit()` of `SVG.Number` which was removed accidentally3.0.8
Diffstat (limited to 'src/types')
-rw-r--r--src/types/SVGNumber.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/types/SVGNumber.js b/src/types/SVGNumber.js
index a152667..4ead46b 100644
--- a/src/types/SVGNumber.js
+++ b/src/types/SVGNumber.js
@@ -88,4 +88,9 @@ export default class SVGNumber {
number = new SVGNumber(number)
return new SVGNumber(this / number, this.unit || number.unit)
}
+
+ unit (unit) {
+ if (unit == null) return this.unit
+ return new SVGNumber(this.value, unit)
+ }
}