Bump roughjs and resolve breaking change in roughjs refactoring… (#1463)

* Fix for roughjs refactoring curve-estinmation code into a separate package

* Update jest transformIgnorePatterns
This commit is contained in:
Preet 2020-04-20 10:43:06 -07:00 committed by GitHub
parent 9b7a743e8b
commit 9ac79061fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 7 deletions

View file

@ -4,7 +4,7 @@ import {
rotate,
isPointInPolygon,
} from "../math";
import { getPointsOnBezierCurves } from "roughjs/bin/geometry";
import { pointsOnBezierCurves } from "points-on-curve";
import { NonDeletedExcalidrawElement } from "./types";
@ -266,7 +266,7 @@ const hitTestCurveInside = (
}
}
if (points.length >= 4) {
const polygonPoints = getPointsOnBezierCurves(points as any, 50);
const polygonPoints = pointsOnBezierCurves(points as any, 10, 5);
return isPointInPolygon(polygonPoints, x, y);
}
return false;