From 14c9151405f38c7f756c910025ea53a6d0b4696e Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 22 May 2020 15:10:20 +1000 Subject: [PATCH] Added proper cursors for the selected tool --- src/components/map/MapInteraction.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/map/MapInteraction.js b/src/components/map/MapInteraction.js index 7227d27..837a49c 100644 --- a/src/components/map/MapInteraction.js +++ b/src/components/map/MapInteraction.js @@ -99,6 +99,19 @@ function MapInteraction({ map, children, controls, selectedToolId }) { stageHeightRef.current = height; } + function getCursorForTool(tool) { + switch (tool) { + case "pan": + return "move"; + case "fog": + case "brush": + case "shape": + return "crosshair"; + default: + return "default"; + } + } + const containerRef = useRef(); usePreventOverscroll(containerRef); @@ -124,7 +137,11 @@ function MapInteraction({ map, children, controls, selectedToolId }) { return (