Add pan tool toolbar
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import type { InteractionMode } from "@editor/tools";
|
||||
import { isPanInteractionMode } from "@editor/tools";
|
||||
import type { CanvasInputState } from "./useCanvasInput";
|
||||
|
||||
export function canvasCursorClass(interactionMode: InteractionMode, input: CanvasInputState) {
|
||||
if (input.isPanning) return "cursor-grabbing";
|
||||
if (interactionMode.type === "temporary-pan") return "cursor-grab";
|
||||
if (isPanInteractionMode(interactionMode)) return "cursor-grab";
|
||||
return "cursor-default";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useState, type RefObject } from "react";
|
||||
import type { AppStore } from "@editor/store";
|
||||
import { isPanInteractionMode } from "@editor/tools";
|
||||
import type { GlobalKeybindConsumer, GlobalPointerConsumer, GlobalWheelConsumer } from "@input/index";
|
||||
import {
|
||||
createViewportPanInputController,
|
||||
@@ -35,7 +36,7 @@ export function useCanvasInput(
|
||||
globalPointerConsumer: options.globalPointerConsumer,
|
||||
dispatch: store.dispatch,
|
||||
getCurrentZoom: () => store.getState().editor.viewport.zoom,
|
||||
isPanMode: () => store.getState().editor.tools.interactionMode.type === "temporary-pan",
|
||||
isPanMode: () => isPanInteractionMode(store.getState().editor.tools.interactionMode),
|
||||
});
|
||||
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user