Fix auto ceiling height sync

This commit is contained in:
Aymeric Rabot
2026-06-06 23:34:33 -04:00
parent dd0215643b
commit 16e09d778d
4 changed files with 312 additions and 36 deletions
+9 -3
View File
@@ -14,6 +14,7 @@ import {
planAutoCeilingsForLevel,
planAutoSlabsForLevel,
planWallMoveJunctions,
projectAutoSlabsForPlan,
resumeSceneHistory,
type SlabNode,
useLiveNodeOverrides,
@@ -266,10 +267,15 @@ export const MoveWallTool: React.FC<{ node: WallNode }> = ({ node }) => {
// existing room → existing slab" logic sees stable IDs across
// ticks. Without this anchor, IDs would drift as overrides
// re-flowed through the planner.
const slabPlan = planAutoSlabsForLevel(roomPolygons, getLevelSlabs(levelId, sceneState.nodes))
const existingSlabs = getLevelSlabs(levelId, sceneState.nodes)
const slabPlan = planAutoSlabsForLevel(roomPolygons, existingSlabs)
const ceilingPlan = planAutoCeilingsForLevel(
roomPolygons,
getLevelCeilings(levelId, sceneState.nodes),
{
walls: levelWalls,
slabs: projectAutoSlabsForPlan(existingSlabs, slabPlan),
},
)
latestSurfacePlans = { slabs: slabPlan, ceilings: ceilingPlan }
@@ -281,8 +287,8 @@ export const MoveWallTool: React.FC<{ node: WallNode }> = ({ node }) => {
touchedSlabIds.add(update.id as AnyNodeId)
}
for (const update of ceilingPlan.update) {
if (update.data.polygon === undefined) continue
overrideEntries.push([update.id, { polygon: update.data.polygon }])
if (update.data.polygon === undefined && update.data.height === undefined) continue
overrideEntries.push([update.id, update.data as Record<string, unknown>])
touchedCeilingIds.add(update.id as AnyNodeId)
}