change distance check to 3

This commit is contained in:
Casper Lamboo 2018-05-02 16:54:19 +02:00
parent 0f70855989
commit 50ff72a037

View File

@ -4,7 +4,7 @@ import earcut from 'earcut';
const TRIANGULATED_OUTLINES = new WeakMap(); const TRIANGULATED_OUTLINES = new WeakMap();
export default function comb(outline, start, end) { export default function comb(outline, start, end) {
if (distanceTo(start, end) < 10) return [start, end]; if (distanceTo(start, end) < 3) return [start, end];
if (!TRIANGULATED_OUTLINES.has(outline)) TRIANGULATED_OUTLINES.set(outline, decompose(outline)); if (!TRIANGULATED_OUTLINES.has(outline)) TRIANGULATED_OUTLINES.set(outline, decompose(outline));
const { convexPolygons, vertices } = TRIANGULATED_OUTLINES.get(outline); const { convexPolygons, vertices } = TRIANGULATED_OUTLINES.get(outline);