review(2-5): code-review pass for per-aircraft drawing — add heading guard, close story

- Add `or 0.0` defensive guard on `aircraft.heading` in `draw_aircraft` per spec (task 1.6)
- Story 2-5 status: review → done
- Sprint status updated: 2-5-per-aircraft-drawing done
- Deferred work: add [2-5] default font 8px readability risk and [2-5] inline arrow geometry constants

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Edholm
2026-04-22 23:29:22 -04:00
parent f530185e31
commit 48a3a1c7dd
4 changed files with 18 additions and 4 deletions
@@ -134,3 +134,17 @@ Description: `_AIRLINE_PREFIXES` contains 23 hand-picked ICAO 3-letter designato
Story: `2-4-altitude-colour-bands-and-aircraft-type-icons`
Category: Technical debt
Description: `_CATEGORY_MAP` maps only ADS-B B-categories (B1B4) to `AircraftType.MILITARY`. Military aircraft that transmit A-category ADS-B codes (e.g. training jets advertising as A3) or no category at all will fall through to the callsign/altitude fallback and be misclassified. A military callsign prefix list (e.g. "RRR", "GAF", "USAF") would improve detection but is not required by any story AC.
---
## Story 2.5: Per-Aircraft Drawing
### [2-5] Default font is 8px — may be unreadable on physical hardware
Story: `2-5-per-aircraft-drawing`
Category: Technical debt
Description: `_draw_label` uses `ImageFont.load_default()` which renders at approximately 8px on the 800×480 display. Callsign and altitude labels may be too small to read at arm's length on the physical e-ink panel. Future hardening: load a bundled bitmap or TrueType font at 1214px (e.g. Pillow's built-in `ImageFont.load_default(size=14)` on Pillow ≥10, or a small `.ttf` bundled under `src/planemapper/assets/`).
### [2-5] Arrow geometry constants are hardcoded inline
Story: `2-5-per-aircraft-drawing`
Category: Technical debt
Description: Arrow tip distance (12px), base half-width (6px), and base offset (8px) are hardcoded inline in `_draw_arrow`. These control icon size and aspect ratio. For Pi Zero 2W or larger displays these values may need tuning. Future hardening: extract to named constants in `constants.py` (e.g. `ARROW_TIP`, `ARROW_BASE_HALF`, `ARROW_BASE_OFFSET`) so they can be adjusted without touching drawing logic.