mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(local-adsb): a click or double-click on a UAT ring takes its aircraft again
The 978 MHz ring was a point on the aircraft's own entity, so a pick on it was a pick on the aircraft. As a separate points set it was drawn unpickable and a click there fell through to what is under it. The rings are picked again and read as their aircraft.
This commit is contained in:
1 parent
aebb3e79c3
commit
6af4b08293
2 files changed
+33
-5
No files matched your search
@@ -1336,3 +1336,29 @@ test('a double-click follows a local aircraft with its card, until it goes, as i
|
||||
await layer.update();
|
||||
assert.equal(followedOf(viewer), null, 'gone, it is no longer followed');
|
||||
});
|
||||
|
||||
test('a click on a UAT ring selects its aircraft, as the ring was a point on its entity', async (t) => {
|
||||
const receiver = fakeReceiver({ mode: 'adsb', connected: true });
|
||||
const feeds = fakeFeeds();
|
||||
const clock = { now: 100_000 };
|
||||
const harness = clickHarness();
|
||||
const { layer, calls, draw } = await enabledLayer(receiver, clock, feeds, {
|
||||
viewer: harness.viewer,
|
||||
});
|
||||
t.after(() => layer.destroy());
|
||||
feeds.set({
|
||||
configured: true,
|
||||
feeds: [{ band: '978', label: '978 MHz UAT', status: 'live' }],
|
||||
records: [record({ icao: 'a1b2c3', band: '978', source: 'feed' })],
|
||||
});
|
||||
await layer.update();
|
||||
const rings = layerSet(draw, ':rings');
|
||||
assert.notEqual(rings.spec.pickable, false, 'the rings are picked');
|
||||
assert.notEqual(ringOf(draw, 'local-adsb:a1b2c3').pickable, false);
|
||||
harness.scene.pickResult = {
|
||||
primitive: {},
|
||||
id: { set: rings.spec.id, id: 'local-adsb:a1b2c3' },
|
||||
};
|
||||
harness.click();
|
||||
assert.deepEqual(calls.selected, ['local-adsb:a1b2c3']);
|
||||
});
|
||||
Reference in new issue
Block a user