Let graphs zoom out to an eighth (#387)

With the Chip and the Filter drawn as devices, a preset such as the
Laser is about 3060 units wide. In a window of 1280 px a fit then hit
the floor of 0.25 and cut the Notes node off on the left.

- ZOOM_LIMITS.min goes from 0.25 to 0.125. The graph zooms without
  steps, so one more step is the floor halved. 0.125 is also the
  smallest step of the scene view.
- It holds for the wheel, for Fit and for the node board of plugins.
- The grid still hides itself below 8 px, so it does not flicker.

Tests:
- Unit plugins and graph-framing: 55 tests green, the floor test now
  expects 0.125.
- e2e 06 (atx): ALL PASSED, 149 checks. Only a comment that named 0.25
  changed there.
- Gate (atx): CHECK EXIT 0, 285 files, 4377 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-10 15:09:05 +02:00
1 parent eb78f3cbf3
commit ab37d3423a
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ import { ViewTween } from '../viewTween';
/** Spacing of the background grid – and, with snapping on, of the positions a drag can leave. */ /** Spacing of the background grid – and, with snapping on, of the positions a drag can leave. */
export const GRID_STEP = 24; export const GRID_STEP = 24;
export const ZOOM_LIMITS = { min: 0.25, max: 2.5 }; export const ZOOM_LIMITS = { min: 0.125, max: 2.5 };
/** Breathing room around the framed nodes, so they do not touch the edge. */ /** Breathing room around the framed nodes, so they do not touch the edge. */
export const FIT_MARGIN = 24; export const FIT_MARGIN = 24;
/** Below this on-screen spacing the grid is noise rather than orientation, so it is dropped. */ /** Below this on-screen spacing the grid is noise rather than orientation, so it is dropped. */
+1 -1
View File
@@ -613,6 +613,6 @@ describe('zooming a graph view about a point', () => {
it('stops at the zoom limits', () => { it('stops at the zoom limits', () => {
expect(zoomedAbout({ pan: { x: 0, y: 0 }, zoom: 2 }, { x: 0, y: 0 }, 10).zoom).toBe(2.5); expect(zoomedAbout({ pan: { x: 0, y: 0 }, zoom: 2 }, { x: 0, y: 0 }, 10).zoom).toBe(2.5);
expect(zoomedAbout({ pan: { x: 0, y: 0 }, zoom: 0.3 }, { x: 0, y: 0 }, 0.1).zoom).toBe(0.25); expect(zoomedAbout({ pan: { x: 0, y: 0 }, zoom: 0.3 }, { x: 0, y: 0 }, 0.1).zoom).toBe(0.125);
}); });
}); });
+1 -1
View File
@@ -569,7 +569,7 @@ export async function graph(t) {
// 6o. Fit really fits: proven against a node parked far outside, and against the fact that the // 6o. Fit really fits: proven against a node parked far outside, and against the fact that the
// graph is then wider than the canvas – otherwise centring alone would pass this check. // graph is then wider than the canvas – otherwise centring alone would pass this check.
// The distance follows the canvas: a fixed 2500 units needs a zoom below the 0.25 floor once // The distance follows the canvas: a fixed 2500 units can need a zoom below the floor once
// the canvas is short, and then Fit cannot fit anything however correct it is. // the canvas is short, and then Fit cannot fit anything however correct it is.
const park = Math.round(area.w); const park = Math.round(area.w);
await evaluate( await evaluate(