Skip to content

Commit

Permalink
Merge pull request #1156 from argos-ci/improve-zoom
Browse files Browse the repository at this point in the history
feat: increase max zoom and wheel speed
  • Loading branch information
gregberge authored Jan 21, 2024
2 parents 731a41c + dc2285c commit b5f9cdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/frontend/src/pages/Build/Zoomer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type ZoomPaneListener = {
};

const MIN_ZOOM_SCALE = 0.1;
const MAX_ZOOM_SCALE = 30;
const MAX_ZOOM_SCALE = 34;

const isWrappedWithClass = (event: any, className: string | undefined) =>
Boolean(event.target.closest(`.${className}`));
Expand Down Expand Up @@ -80,7 +80,7 @@ class Zoomer {
// taken from https://github.com/d3/d3-zoom/blob/master/src/zoom.js
const pinchDelta =
-event.deltaY *
(event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) *
(event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.01) *
2;
const zoom = currentZoom * Math.pow(2, pinchDelta);
this.zoom.scaleTo(this.selection, zoom, point);
Expand Down

0 comments on commit b5f9cdc

Please sign in to comment.