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:
@@ -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,
|
||||
);
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user