fix(nodes): match item floorplan sprite rotation to its footprint box

The footprint polygon uses `rotateVec` (R(-angle)) but the sprite was drawn via
SVG `rotate(+angle)`, so image and box counter-rotated and diverged by 2x the
item's rotation in the 2D floorplan. Negate the image rotation so the sprite
tracks its box (and the 3D orientation). Scoped to items — the only emitter of
the `image` floorplan geometry kind.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-27 20:49:33 -04:00
co-authored by Claude Opus 4.8
parent 03284553aa
commit 81c5b2d22e
+5 -1
View File
@@ -212,7 +212,11 @@ export function buildItemFloorplan(node: ItemNode, ctx: GeometryContext): Floorp
center: [cx, cy],
width,
height: depth,
rotation: transform.rotation,
// `rotateVec` (the footprint polygon) applies R(-angle), but the renderer
// draws the image with SVG `rotate(+deg)` = R(+angle). Negate so the
// sprite rotates the same way as its footprint box (and 3D); otherwise the
// two counter-rotate and diverge by 2x the item's rotation.
rotation: -transform.rotation,
})
}
// Move handle — orange dot at the item center. Only when selected and not