fix: mobile tapping to move cursor
This commit is contained in:
parent
ee94b224af
commit
a301382515
1 changed files with 14 additions and 10 deletions
|
|
@ -173,10 +173,12 @@ function Canvas() {
|
|||
[dragging, coords, scale, tool, mouseCoords, onToolUse, setCoords]
|
||||
);
|
||||
|
||||
const onPointerDown = useCallback(() => {
|
||||
const onPointerDown = useCallback(
|
||||
(e: React.MouseEvent) => {
|
||||
dragging.current = true;
|
||||
|
||||
onToolUse();
|
||||
onPointerMove(e);
|
||||
updateCssCursor();
|
||||
|
||||
dragStartCoordsRef.current = mouseCoords;
|
||||
|
|
@ -185,7 +187,9 @@ function Canvas() {
|
|||
|
||||
// Clear selection on click
|
||||
if (tool === "rectangle-select") setSelectionCoords([]);
|
||||
}, [onToolUse, updateCssCursor, mouseCoords, blocks, selectionCoords, tool, setSelectionCoords]);
|
||||
},
|
||||
[onToolUse, updateCssCursor, mouseCoords, blocks, selectionCoords, tool, setSelectionCoords]
|
||||
);
|
||||
|
||||
const onPointerUp = useCallback(() => {
|
||||
dragging.current = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue