fix: change cursor to move when using move tool
This commit is contained in:
parent
065f8bcf59
commit
ade77b7ce6
2 changed files with 7 additions and 11 deletions
|
|
@ -82,6 +82,7 @@ function Canvas() {
|
|||
const updateCssCursor = useCallback(() => {
|
||||
const cursorMapping: Partial<Record<Tool, string>> = {
|
||||
hand: dragging ? "grab" : "grabbing",
|
||||
move: "move",
|
||||
zoom: holdingAltRef.current ? "zoom-out" : "zoom-in",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -27,18 +27,13 @@ export const ToolProvider = ({ children }: Props) => {
|
|||
const [cssCursor, setCssCursor] = useState("crosshair");
|
||||
|
||||
useEffect(() => {
|
||||
switch (tool) {
|
||||
case "hand":
|
||||
setCssCursor("grab");
|
||||
break;
|
||||
case "zoom":
|
||||
setCssCursor("zoom-in");
|
||||
break;
|
||||
const cursorMapping: Partial<Record<Tool, string>> = {
|
||||
hand: "grab",
|
||||
move: "move",
|
||||
zoom: "zoom-in",
|
||||
};
|
||||
|
||||
default:
|
||||
setCssCursor("crosshair");
|
||||
break;
|
||||
}
|
||||
setCssCursor(cursorMapping[tool] || "crosshair");
|
||||
}, [tool]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue