mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
fix(local-adsb): a tap selects only an aircraft exactly under it again
A click read the scene's exact pick and a drill at the tap. Through the input dispatcher it read the click's id, which on a touch screen comes from the wider contact search: a tap near a local aircraft selected it, and one near another layer's contact kept the selection. It reads the exact top hit again, as the shipwrecks layer does.
This commit is contained in:
1 parent
805c9b5ccd
commit
cbc0c114eb
2 files changed
+42
-4
No files matched your search
@@ -654,10 +654,16 @@ export function createLocalAdsbLayer({
|
||||
const top = event.drawHit;
|
||||
const own = ownHit(top);
|
||||
if (own) return own;
|
||||
// What is on top when it is no draw-set item: a sibling's contact
|
||||
// drawn on its own, a tile, or (on a coarse pointer) a contact found
|
||||
// under the touch.
|
||||
const topId = top ? top.id : event.id;
|
||||
// What is exactly on top when it is no draw-set item: a sibling's
|
||||
// contact drawn on its own, or a tile. Never a touch's wider contact
|
||||
// search: a tap that misses an aircraft selects nothing, and one near
|
||||
// another layer's contact clears the selection, as the exact pick did.
|
||||
const exact = top ? null : event.topHit;
|
||||
const topId = top
|
||||
? top.id
|
||||
: exact && !exact.surface && exact.id != null
|
||||
? String(exact.id)
|
||||
: null;
|
||||
if (!top && topId && markers.has(topId)) return topId;
|
||||
const trail = Boolean(topId) && String(topId).startsWith(TRAIL_PICK_PREFIX);
|
||||
if (ownedElsewhere(topId) && !trail) return 'other';
|
||||
|
||||
Reference in new issue
Block a user