MCPcopy Create free account
hub / github.com/openscopeproject/InteractiveHtmlBom / handlePointerDown

Function handlePointerDown

InteractiveHtmlBom/web/render.js:807–826  ·  view source on GitHub ↗
(e, layerdict)

Source from the content-addressed store, hash-verified

805}
806
807function handlePointerDown(e, layerdict) {
808 if (e.button != 0 && e.button != 1) {
809 return;
810 }
811 e.preventDefault();
812 e.stopPropagation();
813
814 if (!e.hasOwnProperty("offsetX")) {
815 // The polyfill doesn't set this properly
816 e.offsetX = e.pageX - e.currentTarget.offsetLeft;
817 e.offsetY = e.pageY - e.currentTarget.offsetTop;
818 }
819
820 layerdict.pointerStates[e.pointerId] = {
821 distanceTravelled: 0,
822 lastX: e.offsetX,
823 lastY: e.offsetY,
824 downTime: Date.now(),
825 };
826}
827
828function handleMouseClick(e, layerdict) {
829 if (!e.hasOwnProperty("offsetX")) {

Callers 1

addMouseHandlersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected