mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Fade a vessel's callout by its card's painted opacity
The callout now asks for the opacity its own card paints with this frame, keyhole fade included, and fades out as the card fades in. A card faded out at the keyhole rim leaves the callout readable, and a card fading out after leaving its source still hides it. The vessel card id is cached on the record, and the allocation gate covers the lookup.
This commit is contained in:
1 parent
ee3466dff9
commit
da00b096d2
9 files changed
+274
-57
No files matched your search
@@ -117,6 +117,14 @@ export function createCards({
|
||||
/** Stable overlay identity for MMSI-keyed and source-retained unkeyed rows. */
|
||||
|
||||
function vesselOverlayEntryId(record) {
|
||||
// Cached on the record: detection asks for it every frame for every vessel.
|
||||
if (record?.overlayEntryId) return record.overlayEntryId;
|
||||
const id = composeVesselOverlayEntryId(record);
|
||||
if (record) record.overlayEntryId = id;
|
||||
return id;
|
||||
}
|
||||
|
||||
function composeVesselOverlayEntryId(record) {
|
||||
const mmsi = String(record?.mmsi || '').trim();
|
||||
if (mmsi) return `vessel:${mmsi}`;
|
||||
const name = String(record?.name || 'VESSEL').trim() || 'VESSEL';
|
||||
|
||||
@@ -23,6 +23,9 @@ export function normalizeVessel(row) {
|
||||
lastPositionUtc: String(row.last_position_UTC || ''),
|
||||
lastPositionEpoch: finiteNumber(row.last_position_epoch),
|
||||
missedRefreshes: 0,
|
||||
// Filled on first use by the cards' `vesselOverlayEntryId`. The id reads
|
||||
// only the MMSI, or for an unkeyed row fields it never updates.
|
||||
overlayEntryId: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user