refactor(transform): resolve target bounds

This commit is contained in:
syntaxbullet
2026-07-03 16:12:26 +02:00
parent ff5bb43382
commit a3b4a4a1b0
8 changed files with 151 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ import { CanvasViewport } from "./CanvasViewport";
import { LayersSheet } from "./LayersSheet";
import { ToolOverlay } from "./ToolOverlay";
import { labelForTool } from "./toolLabels";
import { resolveTransformTargetBounds } from "@editor/transform-targets";
import { getSelectionSummary } from "./selectionSummary";
import { useAppState } from "./useAppState";
import { useViewportActivityIsland } from "./useViewportActivityIsland";
@@ -20,8 +21,8 @@ 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
const transformBounds = state.editor.transformSession
? resolveTransformTargetBounds(state.document, state.editor.transformSession.target)
: undefined;
return (