This commit is contained in:
Andras Schmelczer 2026-09-11 16:58:56 +01:00
commit 9689bfcc18
23 changed files with 1815 additions and 955 deletions

View file

@ -4,6 +4,7 @@ import { fireplace, rectangle, nextId } from '../lib/defaults';
import { normalizeAngle } from '../lib/geometry';
import { mm } from '../lib/format';
import { NumberField, Issues } from './Fields';
import { DoorPosition } from './DoorPosition';
interface Props {
room: Room;
geometry: Geometry;
@ -87,7 +88,6 @@ export function OutlineEditor({
<>
<div className="editor-heading">
<h2>Room measurements</h2>
<span>Millimetres</span>
</div>
<label className="field">
<span>Room name</span>
@ -267,9 +267,7 @@ export function OutlineEditor({
</h3>
<span>{room.walls.reduce((n, w) => n + w.doors.length, 0)} openings</span>
</div>
<p className="helper">
Width includes trim where skirting stops. Offset is measured from the wall’s start.
</p>
<p className="helper">Door width includes trim where skirting stops.</p>
{room.walls.flatMap((wall, wallIndex) =>
wall.doors.map((door) => (
<div className="door-card" key={door.id}>
@ -312,9 +310,16 @@ export function OutlineEditor({
<Trash2 size={14} />
</button>
</div>
<DoorPosition
wall={wall}
door={door}
wallIndex={wallIndex}
wallCount={room.walls.length}
closed={geometry.closed}
/>
<div className="field-grid">
<NumberField
label="Door offset"
label={`From ${wallIndex === 0 && !geometry.closed ? 'W1 start' : `W${wallIndex === 0 ? room.walls.length : wallIndex} corner`}`}
value={door.offset}
onChange={(n) =>
changeWall(wall.id, (w) => ({