precise-client-coord
v1.0.0
Published
Get clientX and clientY in double type, not integer
Downloads
5
Readme
precise-client-coord
Get clientX and clientY in double type, not integer.
Usage
import { estimateCoord, resetCoordEstimator } from "precise-client-coord";
window.addEventListener("resize", resetCoordEstimator);
window.addEventListener("mousemove", (e) => {
const originalClientX = e.clientX;
const originalClientY = e.clientY;
const { clientX, clientY } = estimateCoord(e);
display(clientX, clientY, originalClientX, originalClientY);
});