fix(editor): point compass needle at true north, not camera

The compass needle rotation was `-floorplanUserRotationDeg`, but the
2D-floorplan SVG and 3D camera projections both place true north at
`+floorplanUserRotationDeg` (= cameraAzimuth − 90°). The negated sign
made the needle rotate opposite to north as the camera orbits, so it
appeared to track the camera instead of pointing north.

The formula was written for the 2D floorplan and reused verbatim when
the compass was portaled into the 3D viewer; both instances had the
flipped sign. "Align to north" is unaffected (userRotation 0 → up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-18 09:13:27 -04:00
co-authored by Claude Opus 4.8
parent 2e5a4ff9d0
commit 222713b26f
@@ -10316,14 +10316,14 @@ export function FloorplanPanel({
(compassHost ? ( (compassHost ? (
createPortal( createPortal(
<FloorplanCompassButton <FloorplanCompassButton
northRotationDeg={-floorplanUserRotationDeg} northRotationDeg={floorplanUserRotationDeg}
onAlignNorth={alignFloorplanViewToNorth} onAlignNorth={alignFloorplanViewToNorth}
/>, />,
compassHost, compassHost,
) )
) : ( ) : (
<FloorplanCompassButton <FloorplanCompassButton
northRotationDeg={-floorplanUserRotationDeg} northRotationDeg={floorplanUserRotationDeg}
onAlignNorth={alignFloorplanViewToNorth} onAlignNorth={alignFloorplanViewToNorth}
/> />
))} ))}