mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Never act on what lies under a mission label when it is clicked
A click on a Space Missions label reaches every click subscriber so they can let go of their selection, but the layers that test their own painted cards or pick the scene themselves still found what lay under the label: CCTV turned that camera on, FIRMS and Vessels selected and flew to theirs, News and Wildlife Sightings opened their item, Perimeters, Ghost Maps and Shipwrecks opened the card's link, ALPR selected its reader, and Local ADS-B drilled the scene itself and selected the aircraft. Each now skips its own test on such a click, and Local ADS-B drills through the click, so the click only releases selections, as a click on empty map or another layer's contact does. Ordinary clicks behave as before. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
8675ead171
commit
5feac417d6
22 files changed
+453
-72
No files matched your search
@@ -184,7 +184,9 @@ function topHitOf(hit, foreign) {
|
||||
* engine's pick objects that reads it here.
|
||||
* @property {boolean} overlay Whether a painted overlay target took the
|
||||
* click ({@link InputDispatcher.onOverlayClick}). Its hits then name only
|
||||
* that target: something drawn outside the draw port, with no id.
|
||||
* that target: something drawn outside the draw port, with no id. A
|
||||
* subscriber with its own hit test (painted cards, a pick of its own)
|
||||
* skips it then: what lies under the target is not clicked.
|
||||
* @property {(width: number, height: number) => unknown} pickWindow
|
||||
* `native.pickWindow`, the same.
|
||||
*/
|
||||
|
||||
@@ -140,3 +140,18 @@ export function fakeInput(viewer, { now } = {}) {
|
||||
destroy: () => input.destroy(),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* `fakeInput` with a label painted over the map, as a Space Missions label
|
||||
* is: while `label.over` is true the label takes each click, so every click
|
||||
* subscriber hears it as an overlay click (`event.overlay`), and the
|
||||
* geometry beneath it is not picked.
|
||||
* @param {object} viewer
|
||||
* @param {{now?: () => number}} [options]
|
||||
*/
|
||||
export function fakeInputUnderLabel(viewer, options) {
|
||||
const fake = fakeInput(viewer, options);
|
||||
const label = { over: false };
|
||||
fake.input.onOverlayClick(() => label.over);
|
||||
return { ...fake, label };
|
||||
}
|
||||
Reference in new issue
Block a user