MCPcopy Index your code
hub / github.com/processing/p5.js / getMouseInfo

Function getMouseInfo

src/events/pointer.js:863–871  ·  view source on GitHub ↗
(canvas, sx, sy, evt)

Source from the content-addressed store, hash-verified

861 };
862
863 function getMouseInfo(canvas, sx, sy, evt) {
864 const rect = canvas.getBoundingClientRect();
865 return {
866 x: (evt.clientX - rect.left) / sx,
867 y: (evt.clientY - rect.top) / sy,
868 winX: evt.clientX,
869 winY: evt.clientY
870 };
871 }
872
873 function getTouchInfo(canvas, sx, sy, touch) {
874 const rect = canvas.getBoundingClientRect();

Callers 1

pointerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected