josie / alder-tools

Graphs: reduce auto-mode scale headroom to 1/4 row

- pad() row_w multiplier 1.0 -> 0.25 (auto mode only; fixed mode
  unchanged). Trace fills more of the box interior while staying ~1/4
  row clear of the borders
- 15 tests, clippy clean; pty-verified 50x100

4197028eb540cd02b55cb2e59828ac66b306cbe1
josie <administrator@josie-c.com> · 2026-09-01T23:15 · browse files at this commit

parents: 6ce4ffc

diff --git a/src/ui.rs b/src/ui.rs
index a144841..af13d85 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -710,10 +710,10 @@ pub fn draw(f: &mut Frame, app: &App) {
                 (vc.0, vc.1, ck.0, ck.1, pw.0, pw.1, tp.0, tp.1)
             };
         // Headroom so the trace fills the interior without kissing the
-        // borders: pad the window span by ~1 interior row top and bottom
+        // borders: pad the window span by ~1/4 interior row top and bottom
         // (plus a small per-metric floor so flat lines don't go degenerate).
         let pad = |lo: f64, hi: f64, floor: f64| -> (f64, f64) {
-            let row_w = ((hi - lo) / (graph_rows.max(1) as f64)).max(floor);
+            let row_w = ((hi - lo) / (graph_rows.max(1) as f64) * 0.25).max(floor);
             ((lo - row_w).max(0.0), hi + row_w)
         };
         let (vc_lo, vc_hi, ck_lo, ck_hi, pw_lo, pw_hi, tp_lo, tp_hi) =