prevent -0
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
export default class Point {
|
export default class Point {
|
||||||
constructor(x, y) {
|
constructor(x, y) {
|
||||||
this.x = Math.round(x);
|
// add zero to turn -0 into 0
|
||||||
this.y = Math.round(y);
|
this.x = Math.round(x) + 0;
|
||||||
|
this.y = Math.round(y) + 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getX() { return this.x; }
|
getX() { return this.x; }
|
||||||
|
|||||||
Reference in New Issue
Block a user