mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
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:
1 parent
cdd855b7ec
commit
d3cc95e9a6
6 files changed
+129
-25
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user