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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -5,7 +5,8 @@
- Connected Room outline and Partition segments now form one seamless thick
wall immediately, including the live rubber-band. Right and oblique corners
use bounded mitre/bevel joins, T-connections have no visible butt face, each
segment keeps its own thickness, and free ends remain flat consistently in
segment keeps its own thickness, and single-segment thickness hover and free
ends remain visible and flat consistently in
Plan, View, static cards, hidden isometric, clean-floor and light geometry
([#141](https://github.com/Matysh/houseplan-card/issues/141)).
- Room outline and Partition drawing now shows wall centre lines and exact
+2 -1
View File
@@ -11,7 +11,8 @@
- Соединённые отрезки «Контура комнаты» и «Перегородки» теперь сразу, включая
активный rubber-band, образуют одну бесшовную толстую стену. Прямые и косые
углы получают ограниченный mitre/bevel, T-соединение не показывает торец,
каждый отрезок сохраняет свою толщину, а свободные концы остаются плоскими в
каждый отрезок сохраняет свою толщину, а hover толщины одиночного сегмента и
свободные концы остаются видимыми и плоскими в
Plan, View, статичной карточке, скрытой изометрии, чистой площади и световой
геометрии ([#141](https://github.com/Matysh/houseplan-card/issues/141)).
- При рисовании инструментами «Контур комнаты» и «Перегородка» поверх
+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 {
+2
View File
@@ -969,6 +969,8 @@ test('split materialisation cuts a partial shared interval at the new divider',
});
test('drawWallPreviewD returns a path for open and closed outlines', () => {
const single = drawWallPreviewD([[0, 0], [10, 0]], 1, false);
assert.ok(single.includes('M'), 'one flat-capped segment remains a visible preview');
const open = drawWallPreviewD([[0, 0], [10, 0], [10, 6]], 1, false);
assert.ok(open.includes('M'));
assert.match(open, /11 -1(?:\D|$)/, 'open preview already contains the 90-degree mitre');