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:
parent
9b7a743e8b
commit
9ac79061fa
30
package-lock.json
generated
30
package-lock.json
generated
@ -14445,6 +14445,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
|
||||||
"integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ=="
|
"integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ=="
|
||||||
},
|
},
|
||||||
|
"path-data-parser": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w=="
|
||||||
|
},
|
||||||
"path-dirname": {
|
"path-dirname": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
|
||||||
@ -14580,6 +14585,20 @@
|
|||||||
"ts-pnp": "^1.1.6"
|
"ts-pnp": "^1.1.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"points-on-curve": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="
|
||||||
|
},
|
||||||
|
"points-on-path": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-X+uusxIDk/DZBC1w6gYCThB9GiSI7wlatxPYmme4wmcWnHFGanxdFBtuZQj1YeYhxXESJ5/Ym/h7DWDMw4A9mA==",
|
||||||
|
"requires": {
|
||||||
|
"path-data-parser": "0.1.0",
|
||||||
|
"points-on-curve": "0.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"portfinder": {
|
"portfinder": {
|
||||||
"version": "1.0.25",
|
"version": "1.0.25",
|
||||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz",
|
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz",
|
||||||
@ -16550,9 +16569,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"roughjs": {
|
"roughjs": {
|
||||||
"version": "4.1.4",
|
"version": "4.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.2.1.tgz",
|
||||||
"integrity": "sha512-Mrx8r/NhTa9K+WuL2YfB5p40OAN/iRXXxmKUf/rxwgRh9Jrgz+dS2DOqnh0uMwzICJ2Rp0xTIFMgdqf0BCsmug=="
|
"integrity": "sha512-OFUpA5smxcA6fE+uX4Nc6cvXMhYJ+/YscePoRyWpH36EJP/2GCtBi9VnhBFIO8lIfTtD0smLoWjVPFFKUMEfpA==",
|
||||||
|
"requires": {
|
||||||
|
"path-data-parser": "^0.1.0",
|
||||||
|
"points-on-curve": "^0.2.0",
|
||||||
|
"points-on-path": "^0.2.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"rsvp": {
|
"rsvp": {
|
||||||
"version": "4.8.5",
|
"version": "4.8.5",
|
||||||
|
@ -25,11 +25,12 @@
|
|||||||
"i18next-browser-languagedetector": "4.1.1",
|
"i18next-browser-languagedetector": "4.1.1",
|
||||||
"nanoid": "2.1.11",
|
"nanoid": "2.1.11",
|
||||||
"open-color": "1.7.0",
|
"open-color": "1.7.0",
|
||||||
|
"points-on-curve": "0.2.0",
|
||||||
"pwacompat": "2.0.11",
|
"pwacompat": "2.0.11",
|
||||||
"react": "16.13.1",
|
"react": "16.13.1",
|
||||||
"react-dom": "16.13.1",
|
"react-dom": "16.13.1",
|
||||||
"react-scripts": "3.4.1",
|
"react-scripts": "3.4.1",
|
||||||
"roughjs": "4.1.4",
|
"roughjs": "4.2.1",
|
||||||
"socket.io-client": "2.3.0"
|
"socket.io-client": "2.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -103,7 +104,7 @@
|
|||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"transformIgnorePatterns": [
|
"transformIgnorePatterns": [
|
||||||
"node_modules/(?!(roughjs|browser-nativefs)/)"
|
"node_modules/(?!(roughjs|points-on-curve|path-data-parser|points-on-path|browser-nativefs)/)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
rotate,
|
rotate,
|
||||||
isPointInPolygon,
|
isPointInPolygon,
|
||||||
} from "../math";
|
} from "../math";
|
||||||
import { getPointsOnBezierCurves } from "roughjs/bin/geometry";
|
import { pointsOnBezierCurves } from "points-on-curve";
|
||||||
|
|
||||||
import { NonDeletedExcalidrawElement } from "./types";
|
import { NonDeletedExcalidrawElement } from "./types";
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ const hitTestCurveInside = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (points.length >= 4) {
|
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 isPointInPolygon(polygonPoints, x, y);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user