(mousePos)
| 592 | |
| 593 | // convert a mouse or touch event position to screen space |
| 594 | function mouseEventToScreen(mousePos) |
| 595 | { |
| 596 | const rect = mainCanvas.getBoundingClientRect(); |
| 597 | const px = percent(mousePos.x, rect.left, rect.right); |
| 598 | const py = percent(mousePos.y, rect.top, rect.bottom); |
| 599 | return vec2(px*mainCanvas.width, py*mainCanvas.height); |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | function inputUpdate() |
no test coverage detected