From 2c04d7f034e596446c0fc286bff4d12df903c029 Mon Sep 17 00:00:00 2001 From: rolandnsharp Date: Sun, 5 Apr 2026 20:01:22 +1000 Subject: [PATCH] Remove crosshair-only grid mode, keep grid on/off toggle Co-Authored-By: Claude Opus 4.6 (1M context) --- src/osc.nim | 5 +---- src/osc/scope.nim | 43 ++++++++++++++++++++----------------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/osc.nim b/src/osc.nim index 7f07396..0248f17 100644 --- a/src/osc.nim +++ b/src/osc.nim @@ -68,10 +68,7 @@ proc main() = of Key.Space: scope.frozen = not scope.frozen of Key.G: - scope.grid = case scope.grid - of gsGrid: gsCross - of gsCross: gsOff - of gsOff: gsGrid + scope.grid = if scope.grid == gsGrid: gsOff else: gsGrid else: discard diff --git a/src/osc/scope.nim b/src/osc/scope.nim index 8cb918a..36ff3b1 100644 --- a/src/osc/scope.nim +++ b/src/osc/scope.nim @@ -10,7 +10,6 @@ type GridStyle* = enum gsGrid ## Full graticule - gsCross ## Center crosshair only gsOff ## No grid Scope* = object @@ -93,33 +92,31 @@ proc drawGraticule*(tb: var TerminalBuffer, w, h: int, grid: GridStyle) = let cx = w div 2 let cy = h div 2 - if grid == gsGrid: - # Division lines - for d in 1..<10: - let x = d * w div 10 - if x > 0 and x < w: - for y in 0.. 0 and y < h: - for x in 0.. 0 and x < w: + for y in 0.. 0 and y < h: + for x in 0.. 0 and x < w: - for dy in 1..<8: - let y = dy * h div 8 - if y > 0 and y < h: - tb.write(x, y, fgGreen, styleDim, "┼") + # Intersections + for dx in 1..<10: + let x = dx * w div 10 + if x > 0 and x < w: + for dy in 1..<8: + let y = dy * h div 8 + if y > 0 and y < h: + tb.write(x, y, fgGreen, styleDim, "┼") # ── HUD ──────────────────────────────────────────────────────────────