refboard: add visible rotate controls

This commit is contained in:
Hiren Kangad
2026-03-13 15:01:25 +05:30
parent cb59fbb150
commit 98fb7be77e
4 changed files with 18 additions and 4 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
/**
* TransformBox — resize/rotate handles around selected scene items.
* TransformBox — resize handles around selected scene items.
*
* Shows 8 resize handles (corners + edge midpoints) + 1 rotation handle
* around the combined bounding rect of selected items.
* Each handle is draggable and applies scale/rotation transforms to the items.
* Shows 8 resize handles (corners + edge midpoints) around the combined
* bounding rect of selected items. Each handle is draggable and applies
* scale transforms to the items.
*/
import { Container, Graphics, FederatedPointerEvent, Text, TextStyle } from 'pixi.js';
@@ -155,6 +155,8 @@ export function buildContextMenuItems(ctx: MenuContext): MenuItem[] {
// -- Image --
{ label: 'Flip Horizontal', shortcut: 'Alt+Shift+H', onClick: () => { ops.flipHorizontal(selected); selection?.transformBox.update(selected); ctx.onChange(ids); }, disabled: !hasSel },
{ label: 'Flip Vertical', shortcut: 'Alt+Shift+V', onClick: () => { ops.flipVertical(selected); selection?.transformBox.update(selected); ctx.onChange(ids); }, disabled: !hasSel },
{ label: 'Rotate Clockwise', shortcut: 'R', onClick: () => { ops.rotate90(selected, true); selection?.transformBox.update(selected); ctx.onChange(ids); }, disabled: !hasSel },
{ label: 'Rotate Counter-Clockwise', shortcut: 'Shift+R', onClick: () => { ops.rotate90(selected, false); selection?.transformBox.update(selected); ctx.onChange(ids); }, disabled: !hasSel },
{ label: 'Crop', shortcut: 'C', onClick: () => ctx.startCrop?.(), disabled: selected.length !== 1 || selected[0]?.data.type !== 'image' },
{ label: 'Reset Transform', shortcut: 'Ctrl+Shift+T', onClick: () => { ops.resetTransform(selected); selection?.transformBox.update(selected); ctx.onChange(ids); }, disabled: !hasSel },
{ label: '', shortcut: '', onClick: () => {}, divider: true },