fix(radio): a double-click follows a station again

Each station, and the selected one's dot, was an entity, which the default
renderer's double-click followed until the stations or the selection were
drawn anew. As draw-port items they took no part in it.
This commit is contained in:
Sameh Khamis committed 2026-11-14 01:20:12 -08:00
1 parent c57a8bea83
commit 6ac8aed1b5
4 files changed
+70

No files matched your search

+12
View File
@@ -1,4 +1,5 @@
import { inputFor } from '../../input/dispatcher.js';
import { followOnDoubleClick } from '../../data/stockFollow.js';
import {
RADIO_PREFIX,
RADIO_PICK_WINDOW_PX,
@@ -98,6 +99,15 @@ export function createInteraction({
);
}
});
// A double-click follows a station, as the default renderer followed
// its entity.
layerState._stockFollow = followOnDoubleClick({
viewer,
inputFor,
name: 'radio',
enabled: () => radioPresentationAllowed(),
targetFor: (hit) => parts.rendering.followTargetFor(hit),
});
// Polling remains bounded during flights, but a stationary camera no longer
// rewrites every station's visibility four times per second while voice and
// audio processing share the main thread.
@@ -111,6 +121,8 @@ export function createInteraction({
unregisterPickOwner('radio');
layerState._clickSubscription?.();
layerState._clickSubscription = null;
layerState._stockFollow?.destroy();
layerState._stockFollow = null;
if (layerState._horizonTimer) clearInterval(layerState._horizonTimer);
layerState._horizonTimer = null;
}