mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-20 11:28:47 +08:00
use Math.abs when calculating lasso area (#673)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user