mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 12:38:12 +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 minimumPolygoneArea = 10;
|
||||||
const { dispatch } = this.props;
|
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.
|
// if less than three points, or super small area, treat as a clear selection.
|
||||||
dispatch({ type: "lasso deselect" });
|
dispatch({ type: "lasso deselect" });
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user