prevent -0

This commit is contained in:
Gavin McDonald
2018-06-25 21:12:09 -04:00
parent bf30d0d303
commit 093bc435af

View File

@@ -1,8 +1,9 @@
export default class Point {
constructor(x, y) {
this.x = Math.round(x);
this.y = Math.round(y);
// add zero to turn -0 into 0
this.x = Math.round(x) + 0;
this.y = Math.round(y) + 0;
}
getX() { return this.x; }