mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-24 04:02:19 +00:00
fix(selection): selecting or tracking a contact never recolours it
A tracked aircraft's icon and 3D model keep the colours they have untracked in Flights and Military Flights (no cyan, no lighter amber); only the icon's alpha changes (stale fade, clear while its model draws). A selected vessel or aid keeps its type colour instead of white, and a tracked satellite's dot keeps its class colour instead of yellow. An emergency stays red while tracked.
This commit is contained in:
1 parent
2f0c01eaa7
commit
f49352d228
23 files changed
+192
-108
No files matched your search
@@ -61,8 +61,6 @@ const HIDDEN_FOLLOW_MS = 250;
|
||||
|
||||
/** A vessel or aid sprite's drawn size before its scale (CSS px). */
|
||||
const SHIP_ICON_PX = 32;
|
||||
/** A selected vessel's or aid's tint. */
|
||||
const SELECTED_TINT = Object.freeze([1, 1, 1, 1]);
|
||||
|
||||
let instances = 0;
|
||||
|
||||
@@ -413,7 +411,6 @@ export function createRendering({
|
||||
|
||||
/** The icon item a record draws, as it now is. */
|
||||
function iconItem(record, visual) {
|
||||
const selected = record === state.selectedRecord;
|
||||
const aid = isAidToNavigation(record);
|
||||
const courseDeg = vesselCourseDeg(record);
|
||||
// Following the clock, not there yet at the time drawn.
|
||||
@@ -430,8 +427,8 @@ export function createRendering({
|
||||
pos: plan?.pos ?? visual.position,
|
||||
image: shipIcon(record),
|
||||
size: [SHIP_ICON_PX, SHIP_ICON_PX],
|
||||
// Tinted by type; selection changes the colour only, never the size.
|
||||
color: selected ? SELECTED_TINT : shipTint(record),
|
||||
// Tinted by type; selection changes neither the colour nor the size.
|
||||
color: shipTint(record),
|
||||
scale: shipScale(record),
|
||||
// An aid's buoy stands upright on screen; a vessel turns with course.
|
||||
rotationMode: aid ? 'screen' : 'course',
|
||||
|
||||
Reference in new issue
Block a user