fix: guard alignment input against numeric-field editing and calibration clicks
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5d80273717
commit
dbb302f765
1 changed files with 4 additions and 0 deletions
|
|
@ -63,6 +63,8 @@ export function mountAlignment(deps: AlignmentDeps): void {
|
||||||
overlay.addEventListener('mousedown', (ev) => {
|
overlay.addEventListener('mousedown', (ev) => {
|
||||||
const H = deps.getHomography();
|
const H = deps.getHomography();
|
||||||
if (!H) return;
|
if (!H) return;
|
||||||
|
// Another module (e.g. calibration) has armed the overlay for this click; don't hijack it.
|
||||||
|
if (!armOrigin && overlay.classList.contains('interactive')) return;
|
||||||
if (armOrigin) {
|
if (armOrigin) {
|
||||||
const a = deps.getAlignment();
|
const a = deps.getAlignment();
|
||||||
const m = imageToMachine(H, normFromEvent(overlay, ev));
|
const m = imageToMachine(H, normFromEvent(overlay, ev));
|
||||||
|
|
@ -98,11 +100,13 @@ export function mountAlignment(deps: AlignmentDeps): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('mouseup', () => {
|
window.addEventListener('mouseup', () => {
|
||||||
|
if (!dragging) return; // only release the overlay if THIS module was dragging
|
||||||
dragging = false;
|
dragging = false;
|
||||||
overlay.classList.remove('interactive');
|
overlay.classList.remove('interactive');
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('keydown', (ev) => {
|
window.addEventListener('keydown', (ev) => {
|
||||||
|
if (document.activeElement instanceof HTMLInputElement) return;
|
||||||
const a = deps.getAlignment();
|
const a = deps.getAlignment();
|
||||||
const step = 1;
|
const step = 1;
|
||||||
if (ev.key === 'ArrowLeft') a.tx -= step;
|
if (ev.key === 'ArrowLeft') a.tx -= step;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue