mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
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:
1 parent
2f0c01eaa7
commit
f49352d228
23 files changed
+192
-108
No files matched your search
@@ -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]);
|
||||
});
|
||||
Reference in new issue
Block a user