diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-11 13:15:08 +1000 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-11 13:15:08 +1000 |
commit | 054eb94e3b20bee182acbc4389fa7736fad72eca (patch) | |
tree | 9f383bcfe4b3fc65ded5acbbc4e25c1372d95d8d /src/modules | |
parent | caaeba44902e91451770d7513355ef70460db18d (diff) | |
download | svg.js-054eb94e3b20bee182acbc4389fa7736fad72eca.tar.gz svg.js-054eb94e3b20bee182acbc4389fa7736fad72eca.zip |
added tests for pointed.js and poly.js
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/core/poly.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/core/poly.js b/src/modules/core/poly.js index 340bdd1..d96d1bc 100644 --- a/src/modules/core/poly.js +++ b/src/modules/core/poly.js @@ -6,13 +6,6 @@ export function array () { return this._array || (this._array = new PointArray(this.attr('points'))) } -// Plot new path -export function plot (p) { - return (p == null) ? this.array() - : this.clear().attr('points', typeof p === 'string' ? p - : (this._array = new PointArray(p))) -} - // Clear array cache export function clear () { delete this._array @@ -24,6 +17,13 @@ export function move (x, y) { return this.attr('points', this.array().move(x, y)) } +// Plot new path +export function plot (p) { + return (p == null) ? this.array() + : this.clear().attr('points', typeof p === 'string' ? p + : (this._array = new PointArray(p))) +} + // Set element size to given width and height export function size (width, height) { const p = proportionalSize(this, width, height) |