(e, rect)
| 8 | } |
| 9 | |
| 10 | function getLocalPointerPos(e, rect) { |
| 11 | let clientX = 0, |
| 12 | clientY = 0; |
| 13 | if (e.touches && e.touches.length > 0) { |
| 14 | clientX = e.touches[0].clientX; |
| 15 | clientY = e.touches[0].clientY; |
| 16 | } else { |
| 17 | clientX = e.clientX; |
| 18 | clientY = e.clientY; |
| 19 | } |
| 20 | return { |
| 21 | x: clientX - rect.left, |
| 22 | y: clientY - rect.top |
| 23 | }; |
| 24 | } |
| 25 | function getMouseDistance(p1, p2) { |
| 26 | const dx = p1.x - p2.x; |
| 27 | const dy = p1.y - p2.y; |
no outgoing calls
no test coverage detected