Skip to content

Instantly share code, notes, and snippets.

@brianpkelley
brianpkelley / PinchZoomPan.js
Last active December 3, 2019 09:11 — forked from iammerrick/PinchZoomPan.js
React Pinch + Zoom + Pan with mouse support
import React from 'react';
const MIN_SCALE = 0.75;
const MAX_SCALE = 2;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;