I am trying both panzoom library in projects. The panzoom is working perfectly but when I try to pause
or dispose
panzoom, it is not working. I have tried multiple approach to solve this but didn't find any working solution.
I have created a canvas then added panzoom to parent element. The panzoom working but pause or destroy not working.
App.svelte
<div id="editor">
<canvas id="canvas" />
</div>
Toolbar.svelte
import panzoom from "panzoom";
function setActive(toolId) {
const instance = panzoom(document.getElementById("editor"));
if (toolId === "choose-color") {
instance.resume();
} else {
instance.dispose();
}
}