Describe the bug
zoomToPoint() does not respect the animate option passed by the caller. Even when explicitly passing { animate: true }, the transition is always disabled.
This appears to be caused by commit ea78bd1, which changed the options merge order in zoomToPoint():
Before (animate could be overridden by caller):
return zoom(toScale, { animate: false, ...zoomOptions, focal }, originalEvent)
After (animate is always false):
return zoom(toScale, { ...zoomOptions, animate: false, focal }, originalEvent)
With the current order, animate: false is placed after ...zoomOptions, so it always overwrites any animate: true passed by the user.
Your environment
- Version of panzoom: 4.6.1
- Browser and browser version: any browser
Expected behavior
When calling panzoom.zoomToPoint(2, event, { animate: true }), the zoom should animate smoothly to the target scale.
Actual behavior
The animate: true option is ignored. The element's inline style always shows transition: none, and the zoom happens instantly without animation.
Steps to reproduce
const panzoom = Panzoom(elem)
elem.addEventListener('dblclick', (event) => {
// This should animate, but it doesn't
panzoom.zoomToPoint(2, event, { animate: true })
})
Describe the bug
zoomToPoint()does not respect theanimateoption passed by the caller. Even when explicitly passing{ animate: true }, the transition is always disabled.This appears to be caused by commit ea78bd1, which changed the options merge order in
zoomToPoint():Before (animate could be overridden by caller):
After (animate is always false):
With the current order,
animate: falseis placed after...zoomOptions, so it always overwrites anyanimate: truepassed by the user.Your environment
Expected behavior
When calling
panzoom.zoomToPoint(2, event, { animate: true }), the zoom should animate smoothly to the target scale.Actual behavior
The
animate: trueoption is ignored. The element's inline style always showstransition: none, and the zoom happens instantly without animation.Steps to reproduce