Remove crosshair-only grid mode, keep grid on/off toggle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rolandnsharp
2026-04-05 20:01:22 +10:00
parent 1f320b7ff1
commit 2c04d7f034
2 changed files with 21 additions and 27 deletions

View File

@@ -68,10 +68,7 @@ proc main() =
of Key.Space: of Key.Space:
scope.frozen = not scope.frozen scope.frozen = not scope.frozen
of Key.G: of Key.G:
scope.grid = case scope.grid scope.grid = if scope.grid == gsGrid: gsOff else: gsGrid
of gsGrid: gsCross
of gsCross: gsOff
of gsOff: gsGrid
else: else:
discard discard

View File

@@ -10,7 +10,6 @@ type
GridStyle* = enum GridStyle* = enum
gsGrid ## Full graticule gsGrid ## Full graticule
gsCross ## Center crosshair only
gsOff ## No grid gsOff ## No grid
Scope* = object Scope* = object
@@ -93,33 +92,31 @@ proc drawGraticule*(tb: var TerminalBuffer, w, h: int, grid: GridStyle) =
let cx = w div 2 let cx = w div 2
let cy = h div 2 let cy = h div 2
if grid == gsGrid: # Division lines
# Division lines for d in 1..<10:
for d in 1..<10: let x = d * w div 10
let x = d * w div 10 if x > 0 and x < w:
if x > 0 and x < w: for y in 0..<h:
for y in 0..<h: tb.write(x, y, fgGreen, styleDim, "")
tb.write(x, y, fgGreen, styleDim, "") for d in 1..<8:
for d in 1..<8: let y = d * h div 8
let y = d * h div 8 if y > 0 and y < h:
if y > 0 and y < h: for x in 0..<w:
for x in 0..<w: tb.write(x, y, fgGreen, styleDim, "")
tb.write(x, y, fgGreen, styleDim, "")
# Center crosshair (shown for both gsGrid and gsCross) # Center crosshair
for x in 0..<w: tb.write(x, cy, fgGreen, styleDim, "") for x in 0..<w: tb.write(x, cy, fgGreen, styleDim, "")
for y in 0..<h: tb.write(cx, y, fgGreen, styleDim, "") for y in 0..<h: tb.write(cx, y, fgGreen, styleDim, "")
tb.write(cx, cy, fgGreen, "") tb.write(cx, cy, fgGreen, "")
if grid == gsGrid: # Intersections
# Intersections for dx in 1..<10:
for dx in 1..<10: let x = dx * w div 10
let x = dx * w div 10 if x > 0 and x < w:
if x > 0 and x < w: for dy in 1..<8:
for dy in 1..<8: let y = dy * h div 8
let y = dy * h div 8 if y > 0 and y < h:
if y > 0 and y < h: tb.write(x, y, fgGreen, styleDim, "")
tb.write(x, y, fgGreen, styleDim, "")
# ── HUD ────────────────────────────────────────────────────────────── # ── HUD ──────────────────────────────────────────────────────────────