From 093bc435aff47d4d1d9532791c1413b3a53a3052 Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Mon, 25 Jun 2018 21:12:09 -0400 Subject: [PATCH] prevent -0 --- src/point.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/point.js b/src/point.js index 117589b..8d96b1f 100644 --- a/src/point.js +++ b/src/point.js @@ -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; }