prevent -0
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user