Skip to content

Commit

Permalink
feat(editor): zoom on pinch closes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Oct 8, 2019
1 parent 3839eb1 commit f0f10b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useD3Zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import * as d3Zoom from 'd3-zoom';
import { select, event } from 'd3-selection';
import { useStoreState, useStoreActions } from 'easy-peasy';

const d3ZoomInstance = d3Zoom.zoom().scaleExtent([0.5, 2]);
const d3ZoomInstance = d3Zoom
.zoom()
.scaleExtent([0.5, 2])
.filter(() => !event.button);

export default function useD3Zoom(zoomPane, onMove, shiftPressed) {
const state = useStoreState(s => ({
Expand Down

0 comments on commit f0f10b6

Please sign in to comment.