Untitled
unknown
javascript
2 years ago
315 B
7
Indexable
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;
Editor is loading...