fix: preserve single wall previews

Issue: #141
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-08-14 12:11:08 +00:00
committed by claude[bot]
parent 087f7cf381
commit 548677a99c
7 changed files with 17 additions and 9 deletions
+5 -1
View File
@@ -625,7 +625,11 @@ function unionSimpleBodies(bodies: number[][][]): any | null {
for (const body of bodies) {
if (body.length < 3) continue;
const piece: any = closedRing(body);
geom = geom ? union(geom, piece) : piece;
// Keep the same MultiPolygon shape for one body and for a union. Returning
// the bare Polygon made `polyclipToPathD()` see points where it expects
// rings, so every single-segment preview (including Thickness hover)
// became an empty path.
geom = geom ? union(geom, piece) : [piece];
}
return geom;
} catch {