diff options
Diffstat (limited to 'src/types/Point.js')
-rw-r--r-- | src/types/Point.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/types/Point.js b/src/types/Point.js index 634ffff..cb09bf3 100644 --- a/src/types/Point.js +++ b/src/types/Point.js @@ -6,6 +6,11 @@ export default class Point { this.init(...args) } + // Clone point + clone () { + return new Point(this) + } + init (x, y) { const base = { x: 0, y: 0 } @@ -21,9 +26,8 @@ export default class Point { return this } - // Clone point - clone () { - return new Point(this) + toArray () { + return [ this.x, this.y ] } transform (m) { @@ -45,9 +49,6 @@ export default class Point { return this } - toArray () { - return [ this.x, this.y ] - } } export function point (x, y) { |