feat(sts-viewer): add item rotation support in inventory

Introduces the ability to rotate inventory items using the Alt button
during drag-and-drop.

- Updates `InventoryItemContainer` to handle rotation via
  `previewRotation`
- Adds `newRotation` parameter to `onMoveItem` callback and `moveItem`
  command
- Updates `InventoryItemState` to manage rotation state and compute
  transformed shapes
- Implements rotation logic in `renderGraphics` using `transformShape`
This commit is contained in:
2026-04-20 21:40:23 +08:00
parent cc796d1e11
commit c9f573ef86
5 changed files with 102 additions and 43 deletions
@@ -93,8 +93,19 @@ export class InventoryTestScene extends ReactiveScene {
this.gridOffsetX,
this.gridOffsetY,
{
onMoveItem: (itemId: string, newX: number, newY: number) => {
return moveItem(this.inventorySignal, itemId, newX, newY);
onMoveItem: (
itemId: string,
newX: number,
newY: number,
newRotation: number,
) => {
return moveItem(
this.inventorySignal,
itemId,
newX,
newY,
newRotation,
);
},
},
);