fix(overlays): let only the topmost painted card act on a click

Card handlers hit-tested only their own source, so a card buried under
another layer's card still acted, and a click on a selected quake card over
a vessel or fire card made both layers act. Vessels, FIRMS, wildlife, news,
ghost maps and shipwrecks now read the unfiltered topmost painted entry:
their own card acts only when it is on top, and a click on another layer's
card is that layer's, so it neither acts here nor clears a selection.

A top news or wildlife card still acts over another layer's scene item, so
it never goes dead over a flight trail or a directions route; a registered
marker under a foreign card is still its layer's to select.
This commit is contained in:
manjunath22466 committed 2026-11-17 01:32:47 +05:30
1 parent 5bc31ce08a
commit 836daf82b3
14 files changed
+310 -43

No files matched your search

+4 -6
View File
@@ -68,14 +68,12 @@ export function createSelection({
? vesselState._vesselOverlayHost.hitTest?.(
event.screenPosition?.x,
event.screenPosition?.y,
{
...(cycloneBackground
? {}
: { sourceId: VESSEL_OVERLAY_SOURCE_ID }),
},
)
: null;
if (cycloneBackground && cardHit?.sourceId !== VESSEL_OVERLAY_SOURCE_ID)
if (
(cardHit && cardHit.sourceId !== VESSEL_OVERLAY_SOURCE_ID) ||
(cycloneBackground && !cardHit)
)
return;
if (!record && cardHit) {
const id = String(cardHit.entryId || '').startsWith('vessel:')