Add pan tool toolbar

This commit is contained in:
syntaxbullet
2026-07-03 11:27:48 +02:00
parent b5c7f87a20
commit 8320203f11
9 changed files with 168 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
export type ToolId = "select" | "pan";
export const availableToolIds = ["select", "pan"] as const;
export type ToolId = (typeof availableToolIds)[number];
export type InteractionMode =
| { type: "tool"; tool: ToolId }
@@ -13,3 +15,7 @@ export const initialToolState: ToolState = {
activeTool: "select",
interactionMode: { type: "tool", tool: "select" },
};
export function isPanInteractionMode(interactionMode: InteractionMode): boolean {
return interactionMode.type === "temporary-pan" || (interactionMode.type === "tool" && interactionMode.tool === "pan");
}