chore(figma-controls): cleanup

This commit is contained in:
moklick
2022-12-12 16:52:31 +01:00
parent ee2f39f2fe
commit 0a2529d26e
4 changed files with 9 additions and 26 deletions
@@ -57,7 +57,7 @@ const FlowRenderer = ({
panOnScrollSpeed,
panOnScrollMode,
zoomOnDoubleClick,
panOnDrag,
panOnDrag: _panOnDrag,
defaultViewport,
translateExtent,
minZoom,
@@ -70,6 +70,9 @@ const FlowRenderer = ({
}: FlowRendererProps) => {
const nodesSelectionActive = useStore(selector);
const selectionKeyPressed = useKeyPress(selectionKeyCode);
const panActivationKeyPressed = useKeyPress(panActivationKeyCode);
const panOnDrag = panActivationKeyPressed || _panOnDrag;
const isSelecting = selectionKeyPressed || (selectionOnDrag && panOnDrag !== true);
useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });
@@ -92,7 +95,6 @@ const FlowRenderer = ({
translateExtent={translateExtent}
minZoom={minZoom}
maxZoom={maxZoom}
panActivationKeyCode={panActivationKeyCode}
zoomActivationKeyCode={zoomActivationKeyCode}
preventScrolling={preventScrolling}
noWheelClassName={noWheelClassName}
@@ -53,12 +53,11 @@ const ZoomPane = ({
panOnScrollMode = PanOnScrollMode.Free,
zoomOnDoubleClick = true,
elementsSelectable,
panOnDrag: _panOnDrag = true,
panOnDrag = true,
defaultViewport,
translateExtent,
minZoom,
maxZoom,
panActivationKeyCode,
zoomActivationKeyCode,
preventScrolling = true,
children,
@@ -73,8 +72,6 @@ const ZoomPane = ({
const prevTransform = useRef<Viewport>({ x: 0, y: 0, zoom: 0 });
const { d3Zoom, d3Selection, d3ZoomHandler, userSelectionActive } = useStore(selector, shallow);
const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);
const panActivationKeyPressed = useKeyPress(panActivationKeyCode);
const panOnDrag = _panOnDrag || panActivationKeyPressed;
useResizeHandler(zoomPane);