summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--CHANGELOG.md9
-rw-r--r--package.json2
-rw-r--r--src/types/SVGNumber.js5
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8207f4f..503e8a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,14 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http:
====
-## [3.0.7] - 2018-01-12
+## [3.0.8] - 2018-01-13
+
+### Fixed
+ - added back `to()` as `unit()` of `SVG.Number` which was removed accidentally
+
+## [3.0.7] - 2018-01-13
+
+### Fixed
- fixed a bug in `isNulledBox()` and `domContains()`
- performance changes:
- replace `getElementsByTagName` with `querySelector`
diff --git a/package.json b/package.json
index 65966ef..0028f7c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@svgdotjs/svg.js",
- "version": "3.0.7",
+ "version": "3.0.8",
"description": "A lightweight library for manipulating and animating SVG.",
"url": "https://svgdotjs.github.io/",
"homepage": "https://svgdotjs.github.io/",
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)
+ }
}