deal with polygons of 0 area

This commit is contained in:
Preet Shihn
2020-01-13 10:03:26 -08:00
parent 8f467c03f4
commit 0ffaf9157f
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "roughjs",
"version": "4.0.0",
"version": "4.0.1",
"description": "Create graphics using HTML Canvas or SVG with a hand-drawn, sketchy, appearance.",
"main": "bundled/rough.cjs.js",
"module": "bin/rough.js",

View File

@@ -74,6 +74,9 @@ function straightHachureLines(points: Point[], o: ResolvedOptions): Line[] {
}
return (e1.ymax - e2.ymax) / Math.abs((e1.ymax - e2.ymax));
});
if (!edges.length) {
return lines;
}
// Start scanning
let activeEdges: ActiveEdgeEntry[] = [];