From 096d477893d0069628e253cd0f8d4076335ef346 Mon Sep 17 00:00:00 2001 From: Charlotte Weaver Date: Wed, 27 Mar 2019 21:02:31 -0700 Subject: [PATCH] use Math.abs when calculating lasso area (#673) --- client/src/components/graph/graph.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/graph/graph.js b/client/src/components/graph/graph.js index 20649564..fb898547 100644 --- a/client/src/components/graph/graph.js +++ b/client/src/components/graph/graph.js @@ -397,7 +397,10 @@ class Graph extends React.Component { const minimumPolygoneArea = 10; const { dispatch } = this.props; - if (polygon.length < 3 || d3.polygonArea(polygon) < minimumPolygoneArea) { + if ( + polygon.length < 3 || + Math.abs(d3.polygonArea(polygon)) < minimumPolygoneArea + ) { // if less than three points, or super small area, treat as a clear selection. dispatch({ type: "lasso deselect" }); } else {