fix(selection): selecting or tracking a contact never recolours it

A tracked aircraft's icon and 3D model keep the colours they have
untracked in Flights and Military Flights (no cyan, no lighter amber);
only the icon's alpha changes (stale fade, clear while its model draws).
A selected vessel or aid keeps its type colour instead of white, and a
tracked satellite's dot keeps its class colour instead of yellow. An
emergency stays red while tracked.
This commit is contained in:
Sameh Khamis committed 2026-11-17 17:49:33 -08:00
1 parent 2f0c01eaa7
commit f49352d228
23 files changed
+192 -108

No files matched your search

+11
View File
@@ -5,6 +5,7 @@ import {
createTrackedAircraftIcon,
isOtherTrackedIconSet,
trackedContactHolder,
trackedIconColor,
} from './trackedAircraftIcon.js';
/** A viewer double with a fake draw port and a frame port whose preRender the test runs. */
@@ -188,3 +189,13 @@ test("a layer tells another layer's tracked icon set from its own sets", () => {
);
assert.equal(isOtherTrackedIconSet(undefined, 'military'), false);
});
test('the tracked icon keeps its contact\'s colour; only the alpha changes', () => {
const amber = Object.freeze([1, 0.72, 0, 1]);
assert.equal(trackedIconColor(amber, 1), amber, 'unchanged at its own alpha');
const stale = trackedIconColor(amber, 0.45);
assert.deepEqual(stale, [1, 0.72, 0, 0.45]);
assert.equal(trackedIconColor(amber, 0.45), stale, 'one array per alpha');
assert.ok(Object.isFrozen(stale));
assert.deepEqual(trackedIconColor(amber, 0), [1, 0.72, 0, 0]);
});