Untitled

mail@pastecode.io avatar
unknown
javascript
2 months ago
315 B
1
Indexable
Never

      const wrapperRect = e.currentTarget.getBoundingClientRect();
      const x = e.clientX - wrapperRect.left;
      const y = e.clientY - wrapperRect.top;
      const zoomLevel = 1.5;
      const newPanX = (x - wrapperRect.width / 2) * zoomLevel;
      const newPanY = (y - wrapperRect.height / 2) * zoomLevel;