-
Notifications
You must be signed in to change notification settings - Fork 335
Closed
Description
if pinch is enabled, then zoom happens without the onZoomStart being called. I think this is a quick fix. Can i open a PR to add the onZoomStart function before the zoom call?
function handlePinch(chart, state, e) {
if (state.scale) {
const {center, pointers} = e;
// Hammer reports the total scaling. We need the incremental amount
const zoomPercent = 1 / state.scale * e.scale;
const rect = e.target.getBoundingClientRect();
const pinch = pinchAxes(pointers[0], pointers[1]);
const mode = state.options.zoom.mode;
const amount = {
x: pinch.x && directionEnabled(mode, 'x', chart) ? zoomPercent : 1,
y: pinch.y && directionEnabled(mode, 'y', chart) ? zoomPercent : 1,
focalPoint: {
x: center.x - rect.left,
y: center.y - rect.top
}
};
zoom(chart, amount);
// Keep track of overall scale
state.scale = e.scale;
}
}
Metadata
Metadata
Assignees
Labels
No labels