A transit vehicle coming into view is turned along its course at once

The rotation pass reprojected courses only when the camera moved, a poll
marked a course, or a vehicle was moving. A vehicle that entered the view
or was shown on a later visibility sweep (its ground height arriving
after its poll) kept the icon pointing up until one of those happened,
under a camera that held still. The visibility sweep now marks the
rotations for the next pass when it changes what is in view or shown.
This commit is contained in:
Sameh Khamis committed 2026-11-11 08:16:27 -08:00
1 parent 6fc1aaff02
commit 37d44c3364
2 files changed
+21 -1

No files matched your search

+15
View File
@@ -4373,6 +4373,21 @@ test('parked transit reprojects held and reported courses at the bounded camera
0, 0,
'selected unknown course also stays screen-up', 'selected unknown course also stays screen-up',
); );
state._selectedKey = null;
// A vehicle coming into view is turned on the next pass, the camera still.
state._visible.delete(held);
held.marker.rotation = 0.7;
held.rotationCourse = undefined;
Object.assign(state, {
_visibilityAt: 0,
_stillIcons: { upsert: noop, remove: noop },
_movingIcons: { upsert: noop, remove: noop },
});
rendering.refreshVisibility();
assert.ok(state._visible.has(held), 'back in view');
t.mock.timers.tick(200);
rendering.onPreRender();
assert.notEqual(held.marker.rotation, 0.7, 'turned once in view');
}); });
test('a view with no feed reads its coverage prompt, not an undated feed', async (t) => { test('a view with no feed reads its coverage prompt, not an undated feed', async (t) => {
+6 -1
View File
@@ -970,7 +970,12 @@ export function createRendering({ state, services, parts }) {
} }
flushMarkers(); flushMarkers();
state._shownCount = state._visible.size; state._shownCount = state._visible.size;
if (changed) state._detectRevision++; if (changed) {
state._detectRevision++;
// A vehicle that came into view or was shown is turned on the next
// rotation pass, though neither the camera nor a poll changed.
state._rotationDirty = true;
}
syncRenderHold(); syncRenderHold();
governorRequestRender('transit-visibility'); governorRequestRender('transit-visibility');
return state._shownCount; return state._shownCount;