(radius)
| 1455 | } |
| 1456 | |
| 1457 | function correctRadius (radius) { |
| 1458 | let aspectRatio = canvas.width / canvas.height; |
| 1459 | if (aspectRatio > 1) |
| 1460 | radius *= aspectRatio; |
| 1461 | return radius; |
| 1462 | } |
| 1463 | |
| 1464 | canvas.addEventListener('mousedown', e => { |
| 1465 | let posX = scaleByPixelRatio(e.offsetX); |