mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
A wreck is selected only by a tap exactly on it
The shipwrecks layer reads the click's top hit, as it read the scene's exact pick before, not the touch contact search's wider hit: a tap that misses everything near a wreck selects nothing, and a tap near another layer's contact closes an open wreck card.
This commit is contained in:
1 parent
46c98796de
commit
6fc1aaff02
2 files changed
+38
-3
No files matched your search
@@ -285,8 +285,11 @@ export function createShipwrecksLayer({
|
||||
if (_selectedLink) openExternal(_selectedLink);
|
||||
return;
|
||||
}
|
||||
// A marker's item id is its pick id, `shipwreck:<id>`.
|
||||
const pickId = click.id ?? null;
|
||||
// A marker's item id is its pick id, `shipwreck:<id>`. Read from what is
|
||||
// exactly under the click: a touch's wider contact search would pick a
|
||||
// wreck the tap missed, or a contact near one.
|
||||
const picked = click.topHit;
|
||||
const pickId = picked ? (picking.resolvePickId(picked) ?? null) : null;
|
||||
const id = pickedRecordId(pickId);
|
||||
if (id) {
|
||||
_selectedId = id;
|
||||
|
||||
Reference in new issue
Block a user