Amit Haridas
98979a2cd2
feat(flowchart): pure viewport math for zoom/pan/snap (C4a)
...
New pure functions for the canvas viewport (v4.13.0):
- zoomAt(view, screenX, screenY, factor) — zoom centred on a screen
point, keeping the world point under cursor fixed. Clamped to
[0.25, 4] scale range.
- panBy(view, dx, dy) — additive pan
- reset() — identity transform
- wheelFactor(deltaY) — multiplicative factor per Ctrl+wheel notch
- snap(value, gridSize) — round to nearest grid (0 disables)
The actual SVG transform wrapper + Ctrl+wheel handler + drag-to-pan
+ snap-on-move is the next canvas-layer commit; this commit lands
the testable math.
14 new tests cover: identity reset, cursor-stable zoom, MIN/MAX
clamping, additive pan, wheel factor reciprocity, snap-to-grid
(positive/negative/zero grid sizes).
Amit Haridas
2026-09-30 21:28:36 +05:30
..
2026-09-14 21:36:02 +05:30
2026-09-14 20:46:49 +05:30
2026-09-30 20:04:32 +05:30
2026-09-05 20:48:39 +05:30
2026-09-14 22:37:02 +05:30
2026-09-30 20:30:19 +05:30
2026-09-14 00:00:16 +05:30
2026-09-14 00:00:16 +05:30
2026-09-05 21:53:34 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 14:56:05 +05:30
2026-09-14 14:56:05 +05:30
2026-09-14 14:56:05 +05:30
2026-08-23 19:31:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 21:36:02 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 21:36:02 +05:30
2026-08-23 19:31:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-30 21:23:39 +05:30
2026-09-15 09:23:58 +05:30
2026-09-14 21:36:02 +05:30
2026-09-14 23:09:23 +05:30
2026-09-15 09:23:58 +05:30
2026-09-15 09:23:58 +05:30
2026-09-30 21:28:36 +05:30
2026-09-14 14:56:05 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-05 21:53:34 +05:30
2026-09-30 21:02:28 +05:30
2026-09-30 20:14:13 +05:30
2026-09-30 20:01:54 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-06-30 12:56:33 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 00:00:16 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 23:59:53 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 22:48:45 +05:30
2026-08-23 19:31:33 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-04-23 22:55:12 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 21:06:28 +05:30
2026-09-14 21:06:28 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 21:53:34 +05:30
2026-06-30 13:57:34 +05:30
2026-09-30 19:53:44 +05:30
2026-09-30 19:58:18 +05:30
2026-09-14 14:56:05 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 20:48:39 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 14:56:05 +05:30
2026-08-23 19:31:33 +05:30
2026-09-05 21:53:34 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 20:11:44 +05:30
2026-08-23 19:31:33 +05:30
2026-09-05 20:48:39 +05:30
2026-08-23 19:31:33 +05:30
2026-09-30 20:28:22 +05:30
2026-09-30 19:56:50 +05:30
2026-09-14 14:56:05 +05:30