Closed thepaperpilot closed 3 years ago
transformOrigin
Kindly try setting it on the panzoom instance like so panzoomInstance.setTransformOrigin(null)
In your template
<panZoom @init="onInit"></panZoom>
In the methods of your script
onInit: function(panzoomInstance, id) {
panzoomInstance.setTransformOrigin(null);
}
Thank you, that works perfectly!
By default panzoom zooms around the mouse, rather than the screen center. This is represented by the options object having transformOrigin set to null.
vue-panzoom has a default options which sets transformOrigin to { x: .5, y: .5 }, which represents zooming around the screen center. If I pass an options object with { transformOrigin: null }, it does not override the default value - I suspect because it ignores null values.