fix(transit): a selected vehicle's trail head is one outlined line again, its centre no darker than before

The seam drew the head as two stacked translucent lanes (a 5 px dark
backing under a 3 px colour line), which darkened its centre by up to 40
of 255 over light ground. It is now one 5 px line with a 2 px dark
outline in the same pass, as the head's own material drew it before.

Conformance gains draw.lines.outlineDraped: a draped, translucent,
revealed outlined line, its centre as bright as a plain line of the
colour, its edges dark, nothing past the reveal.
This commit is contained in:
Sameh Khamis committed 2026-11-14 12:35:24 -08:00
1 parent cdd855b7ec
commit d3cc95e9a6
6 files changed
+129 -25

No files matched your search

+25 -10
View File
@@ -135,17 +135,32 @@ export function createContactTrailRenderer(viewer) {
return lines;
}
/** The head's lines over `segment`, revealed to `fraction`. */
/**
* The head over `segment`, revealed to `fraction`: one line the backing's
* width, its edge the backing's colour and its centre the line's width,
* in one pass. Two lanes stacked would darken the centre where their
* translucent passes overlap.
*/
function headItems(segment, fraction) {
return LANES.map((lane) => ({
id: lane.name,
positions: segment.positions,
widthPx: lane.widthPx,
mode: 'draped',
clampTo: 'both',
style: { kind: 'solid', color: tint(HEAD_ALPHA, lane.dark) },
revealFraction: fraction,
}));
const [backingLane, lineLane] = LANES;
return [
{
id: 'head',
positions: segment.positions,
widthPx: backingLane.widthPx,
mode: 'draped',
clampTo: 'both',
style: {
kind: 'solid',
color: tint(HEAD_ALPHA, false),
outline: {
color: tint(HEAD_ALPHA, true),
widthPx: backingLane.widthPx - lineLane.widthPx,
},
},
revealFraction: fraction,
},
];
}
// Written only when it changes: a renderer may redraw for each write.