(e)
| 4491 | }); |
| 4492 | |
| 4493 | function onRotMove(e) { |
| 4494 | if (!rotating) return; |
| 4495 | const el = elements.find((x) => x.id === elementId); |
| 4496 | if (!el || el.locked || el.hidden) return; |
| 4497 | const cx = el.x + el.w / 2; |
| 4498 | const cy = el.y + el.h / 2; |
| 4499 | const p = clientToArtboardPx(e.clientX, e.clientY); |
| 4500 | const a1 = Math.atan2(p.y - cy, p.x - cx) * (180 / Math.PI); |
| 4501 | let delta = a1 - startAngleDeg; |
| 4502 | while (delta > 180) delta -= 360; |
| 4503 | while (delta < -180) delta += 360; |
| 4504 | let rot = startRot + delta; |
| 4505 | if (e.shiftKey) rot = Math.round(rot / 15) * 15; |
| 4506 | el.rotation = Math.round(rot); |
| 4507 | updatePropsInputs(false); |
| 4508 | renderElements(); |
| 4509 | renderLayers(); |
| 4510 | updateCode(); |
| 4511 | } |
| 4512 | |
| 4513 | function onRotUp() { |
| 4514 | if (rotating) pushHistory(); |
nothing calls this directly
no test coverage detected