mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Let every click subscriber hear a mission-label click
A click a painted overlay handled, such as a Space Missions label, returned before any click subscriber ran, so the layers that close their cards or let go of their selection on a click never heard it. Now only the picking the label replaces is skipped: subscribers still hear the click, marked as an overlay click whose hit is the label (no draw set, no id, nothing drilled), and the geometry beneath it is not picked. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
ee37511332
commit
9ac937af82
4 files changed
+109
-13
No files matched your search
@@ -118,11 +118,15 @@ const label = (
|
||||
entryId,
|
||||
});
|
||||
|
||||
test('a mission label click focuses its launch and stops the click there', (t) => {
|
||||
const r = rig(t, { overlayHit: label('launch:L2') });
|
||||
test('a mission label click focuses its launch and covers the geometry beneath', (t) => {
|
||||
const r = rig(t, { overlayHit: label('launch:L2'), geometryLaunchId: 'L1' });
|
||||
r.click();
|
||||
assert.deepEqual(r.focused, ['L2']);
|
||||
assert.equal(r.ambient.length, 0, 'the layers beneath do not see it');
|
||||
assert.deepEqual(r.focused, ['L2'], 'the mission beneath is not picked');
|
||||
// Other layers still hear it, to close their cards or clear selection,
|
||||
// as a click on the label rather than on the geometry beneath.
|
||||
assert.equal(r.ambient.length, 1);
|
||||
assert.equal(r.ambient[0].overlay, true);
|
||||
assert.equal(r.ambient[0].drawHit, null);
|
||||
|
||||
r.setHit(label('launch:L1', ROCKET_MISSION_SELECTED_OVERLAY_SOURCE_ID));
|
||||
r.click();
|
||||
@@ -156,7 +160,8 @@ test('a throwing globe-pick listener does not stop the pick', (t) => {
|
||||
r.click();
|
||||
assert.deepEqual(r.focused, ['L1']);
|
||||
assert.deepEqual(heard, ['L1']);
|
||||
assert.equal(r.ambient.length, 0);
|
||||
assert.equal(r.ambient.length, 1);
|
||||
assert.equal(r.ambient[0].overlay, true);
|
||||
});
|
||||
|
||||
test('a mission label for an unknown launch falls through to other layers', (t) => {
|
||||
|
||||
Reference in new issue
Block a user