Closed roonie007 closed 2 years ago
Thanks for opening an issue. My guess is it's working with the script tag not because the code is somehow different but because the script is loading at a different time. You could get different results depending on whether the CSS had been rendered or not when Panzoom is initialized. 4.4.3 had a bug where if the element's size ever changed, the dimensions for contain would be off. That is fixed on the main branch and I just released 4.4.4. I tried 4.4.4 in your sandbox and it seems to work now.
Thanks, I can confirm bumping to 4.4.4 everything works perfectly.
IMPORTANT:
import panzoom from '@panzoom/panzoom';
Describe the bug
I have a canvas with the size 10000x10000, when using
contain: 'outside'
, theminScale
option is not respected.if i remove the
contain: 'outside'
theminScale
is respected correctly.Your environment
Expected behavior
minScale
should be taken in account and zooming out should not go beyondminScale
Actual behavior
If you set something like this:
You can always zoom out to 0.1823.
The
minScale
is not respected, but itmaxScale
is respectedSteps to reproduce
https://codesandbox.io/s/stoic-gates-nhpyq?file=/src/App.vue