diff --git a/src/components/frontend/garage/GarageGrid.tsx b/src/components/frontend/garage/GarageGrid.tsx index 10288ca0..157b4baf 100644 --- a/src/components/frontend/garage/GarageGrid.tsx +++ b/src/components/frontend/garage/GarageGrid.tsx @@ -346,6 +346,16 @@ export function GarageGrid({ } }; + // Drag preview must track mid-drag rotation: dnd-kit pins the overlay + // container to the activator rect captured at drag start, so we override + // its width/height via the style prop (spread after the pinned rect). + const overlayFp = activeItem + ? { + width: pendingRotated ? activeItem.height : activeItem.width, + height: pendingRotated ? activeItem.width : activeItem.height, + } + : null; + return ( drag to move · R to rotate} - + {activeItem ? ( -
+
) : null} diff --git a/src/components/frontend/locker/LockerGrid.tsx b/src/components/frontend/locker/LockerGrid.tsx index cbc87b67..1e8b1c3b 100644 --- a/src/components/frontend/locker/LockerGrid.tsx +++ b/src/components/frontend/locker/LockerGrid.tsx @@ -544,6 +544,13 @@ export function LockerGrid({ onSelectItem(null); }, [onSelectItem]); + // Drag preview must track mid-drag rotation: dnd-kit pins the overlay + // container to the activator rect captured at drag start, so we override + // its width/height via the style prop (spread after the pinned rect). + const overlayFp = activeItem + ? getLockerItemFootprint(activeItem.asset, pendingRotated) + : null; + return ( {/* Tactical drag overlay */} - + {activeItem && ( -
+
- + { + // dnd-kit pins the overlay container to the activator rect + // from drag start; override width/height so mid-drag rotation + // resizes the preview (style is spread after the pinned rect). + const fp = getItemFootprint(activeItem.resource as Resource, pendingRotated); + return { width: fp.width * cellSize - 2, height: fp.height * cellSize - 2 }; + })() + : undefined + } + > {activeItem && ( )}