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

Function getTouchInfo

src/events/pointer.js:873–882  ·  view source on GitHub ↗
(canvas, sx, sy, touch)

Source from the content-addressed store, hash-verified

871 }
872
873 function getTouchInfo(canvas, sx, sy, touch) {
874 const rect = canvas.getBoundingClientRect();
875 return {
876 x: (touch.clientX - rect.left) / sx,
877 y: (touch.clientY - rect.top) / sy,
878 winX: touch.clientX,
879 winY: touch.clientY,
880 id: touch.pointerId
881 };
882 }
883
884 fn._setMouseButton = function(e) {
885 // Check all active touches to determine button states

Callers 1

pointerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected