feat(view): show transform measurements

This commit is contained in:
syntaxbullet
2026-07-03 16:08:45 +02:00
parent 166310ace0
commit ff5bb43382
3 changed files with 40 additions and 3 deletions

View File

@@ -20,6 +20,9 @@ export function App({ app }: AppProps) {
const viewportActivityIsland = useViewportActivityIsland(state.editor.viewport);
const [layersOpen, setLayersOpen] = useState(false);
const selectionSummary = getSelectionSummary(state.document, state.editor.selection);
const transformBounds = state.editor.transformSession?.target.type === "artboard"
? state.document.artboards.find((artboard) => artboard.id === state.editor.transformSession?.target.id)?.bounds
: undefined;
return (
<main className="relative h-full overflow-hidden bg-background text-foreground">
@@ -41,9 +44,10 @@ export function App({ app }: AppProps) {
<div className="absolute inset-x-0 bottom-4 z-10 flex justify-center">
<BottomControlsIsland
viewport={state.editor.viewport}
visible={selectionSummary.type !== "none" || viewportActivityIsland.visible}
visible={Boolean(transformBounds) || selectionSummary.type !== "none" || viewportActivityIsland.visible}
action={viewportActivityIsland.action}
selection={selectionSummary}
transformBounds={transformBounds}
dispatch={app.store.dispatch}
onOpenLayers={() => setLayersOpen(true)}
/>