mirror of
https://github.com/n30nex/CartoLite-Server.git
synced 2026-10-23 08:32:39 +00:00
Only pick visible live paths when route history is hidden
This commit is contained in:
1 parent
915c1ab7de
commit
4b64d8417a
2 files changed
+12
No files matched your search
@@ -82,6 +82,13 @@ test('3D starts top-down, frames neighbours, inspects the drawn curve and preser
|
||||
if (await choice.isVisible()) await choice.click();
|
||||
await expect(stage).toHaveAttribute('data-selected-route-id', 'visual-hop');
|
||||
await expect(inspector).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Close connection details' }).click();
|
||||
await page.locator('#graph-routes-button').click();
|
||||
await expect(stage).toHaveAttribute('data-history-routes', 'false');
|
||||
await stage.click({ position: { x: midpoint[0]!, y: midpoint[1]! } });
|
||||
await expect(stage).toHaveAttribute('data-selected-route-id', '');
|
||||
await expect(inspector).toBeHidden();
|
||||
await page.locator('#graph-routes-button').click();
|
||||
await page.locator('#display-button').click();
|
||||
await page.getByRole('button', { name: 'Rotate topology right' }).click();
|
||||
await expect.poll(() => stage.getAttribute('data-view-yaw').then(Number)).toBeGreaterThan(0.2);
|
||||
|
||||
@@ -1704,7 +1704,12 @@ export class NetgraphRenderer implements ViewportProjector {
|
||||
|
||||
#nearestRoutes(x: number, y: number): string[] {
|
||||
const hits: Array<{ id: string; distance: number }> = [];
|
||||
const lit = this.#regionLayout.routes ? null : new Set([
|
||||
...this.#residue.map(r => r.routeId),
|
||||
...this.#activeRoutes.flatMap(a => a.packet.segments.map(s => s.routeId)),
|
||||
]);
|
||||
for (const route of this.#visibleRoutes) {
|
||||
if (lit && !lit.has(route.id)) continue;
|
||||
const path = this.#routePath(route.fromId, route.toId);
|
||||
const distance = distanceToGraphPath(path, x, y);
|
||||
if (distance <= Math.max(7, displayPreferences().width + 4)) hits.push({ id: route.id, distance });
|
||||
|
||||
Reference in new issue
Block a user