Download src/lib/touch-utils.js from soiz1/s4s-paint: direct link, hf CLI and curl.
- Browser
- Download file 500 Bytes
-
https://huggingface.co/datasets/soiz1/s4s-paint/resolve/main/src/lib/touch-utils.js
- Command line
-
hf download hf://datasets/soiz1/s4s-paint/src/lib/touch-utils.js
-
curl -L -o touch-utils.js https://huggingface.co/datasets/soiz1/s4s-paint/resolve/main/src/lib/touch-utils.js
500 Bytes
| /* DO NOT EDIT | |
| @todo This file is copied from GUI and should be pulled out into a shared library. | |
| See https://github.com/LLK/scratch-paint/issues/13 */ | |
| const getEventXY = e => { | |
| if (e.touches && e.touches[0]) { | |
| return {x: e.touches[0].clientX, y: e.touches[0].clientY}; | |
| } else if (e.changedTouches && e.changedTouches[0]) { | |
| return {x: e.changedTouches[0].clientX, y: e.changedTouches[0].clientY}; | |
| } | |
| return {x: e.clientX, y: e.clientY}; | |
| }; | |
| export { | |
| getEventXY | |
| }; | |