Add ASCII-art layout diagram to render.rs
Makes the nine layout constants self-documenting by showing which value controls which part of the window (cell size, menu bar, panel margin, side panel, and overall window dimensions). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,29 @@
|
|||||||
|
// Layout constants — which value controls which part of the window:
|
||||||
|
//
|
||||||
|
// One board cell:
|
||||||
|
//
|
||||||
|
// ◄── CELL_W (14 px) ──►
|
||||||
|
// ╔════════════════════╗ ▲
|
||||||
|
// ║ @ ║ │ CELL_H (20 px)
|
||||||
|
// ╚════════════════════╝ ▼
|
||||||
|
//
|
||||||
|
// Full window (Edit mode shown; side panel absent in Play mode):
|
||||||
|
//
|
||||||
|
// ◄────────────────── DEFAULT_WINDOW_W (840 px) ───────────────────►
|
||||||
|
// ┌────────────────────────────────────────────────────────────────┐ ▲
|
||||||
|
// │ File │ Play Edit │ │ MENU_H (24 px)
|
||||||
|
// ├────────────────────────────────────────────────┬───────────────┤ ▼
|
||||||
|
// │ PANEL_MARGIN (8 px) on all sides │ PALETTE_ │ ▲
|
||||||
|
// │ ┌──────────────────────────────────────────┐ │ PANEL_W │ │
|
||||||
|
// │ │ │ │ (200 px) │ │ DEFAULT_
|
||||||
|
// │ │ board cells (CELL_W × CELL_H each) │ │ Edit mode │ │ WINDOW_H
|
||||||
|
// │ │ │ │ only │ │ (524 px)
|
||||||
|
// │ └──────────────────────────────────────────┘ │ │ │
|
||||||
|
// │ │ │ ▼
|
||||||
|
// └────────────────────────────────────────────────┴───────────────┘
|
||||||
|
//
|
||||||
|
// MIN_WINDOW_W and MIN_WINDOW_H are derived: 10 cells wide / 5 cells tall plus margins.
|
||||||
|
|
||||||
use eframe::egui;
|
use eframe::egui;
|
||||||
use egui::{Align2, FontId, Pos2, Rect, vec2};
|
use egui::{Align2, FontId, Pos2, Rect, vec2};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user