Skip to content

Commit

Permalink
added back to() as unit() of SVG.Number which was removed accid…
Browse files Browse the repository at this point in the history
…entally
  • Loading branch information
Fuzzyma committed Jan 13, 2019
1 parent b1c3146 commit 8802d25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down
5 changes: 5 additions & 0 deletions src/types/SVGNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 8802d25

Please sign in to comment.