mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-28 06:34:13 +00:00
feat: zoom tool
This commit is contained in:
parent
ceb87c2088
commit
57064e71c7
3 changed files with 67 additions and 19 deletions
|
|
@ -19,7 +19,18 @@ export const ToolProvider = ({ children }: Props) => {
|
|||
const [cssCursor, setCssCursor] = useState("pointer");
|
||||
|
||||
useEffect(() => {
|
||||
setCssCursor(tool === "hand" ? "grab" : "pointer");
|
||||
switch (tool) {
|
||||
case "hand":
|
||||
setCssCursor("grab");
|
||||
break;
|
||||
case "zoom":
|
||||
setCssCursor("zoom-in");
|
||||
break;
|
||||
|
||||
default:
|
||||
setCssCursor("pointer");
|
||||
break;
|
||||
}
|
||||
}, [tool]);
|
||||
|
||||
return <ToolContext.Provider value={{ tool, selectedBlock, cssCursor, setTool, setSelectedBlock, setCssCursor }}>{children}</ToolContext.Provider>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue