From 054eb94e3b20bee182acbc4389fa7736fad72eca Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sat, 11 Apr 2020 13:15:08 +1000 Subject: added tests for pointed.js and poly.js --- src/modules/core/poly.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modules/core') 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) -- cgit v1.2.3