[*] wrapping for flatXY

This commit is contained in:
Gavin McDonald
2018-12-15 11:35:17 -05:00
parent ad4a16b796
commit 9b4f2e92ad
5 changed files with 61 additions and 14 deletions

View File

@@ -1,6 +1,11 @@
export default class Point {
constructor(x, y) {
if (typeof x === 'object') {
y = x.y;
x = x.x;
}
// add zero to turn -0 into 0
this.x = Math.round(x) + 0;
this.y = Math.round(y) + 0;