Skip to content

Commit

Permalink
Fix canvas states for changing cursor (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
tddough98 authored Jan 14, 2022
1 parent c35ba7b commit 6ce0614
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions visualizer/src/Canvas/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ export const Canvas = () => {
const sh = useSelector(canvas, (state) => state.context.height);
const scale = useSelector(canvas, (state) => state.context.scale);

const grab = useSelector(canvas, (state) => state.matches('pan.grab'));
const grabbing = useSelector(canvas, (state) => state.matches('pan.grab.panning'));
const dragged = useSelector(canvas, (state) =>
state.matches('pan.interactive.panOnDrag.dragged')
);
const grab = useSelector(canvas, (state) => state.matches('grab'));
const grabbing = useSelector(canvas, (state) => state.matches('grab.panning'));
const dragged = useSelector(canvas, (state) => state.matches('interactive.panOnDrag.dragged'));
const cursor = grabbing || dragged ? 'grabbing' : grab ? 'grab' : 'crosshair';

const segment = useSegment();
Expand Down

0 comments on commit 6ce0614

Please sign in to comment.