MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / getMousePosition

Function getMousePosition

assets/js/draw.js:125–131  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

123
124// Get Mouse Position
125function getMousePosition(event) {
126 const boundaries = canvas.getBoundingClientRect();
127 return {
128 x: event.clientX - boundaries.left,
129 y: event.clientY - boundaries.top,
130 };
131}
132
133// Mouse Down
134canvas.addEventListener('mousedown', (event) => {

Callers 1

draw.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected