Size window to fit board including panel margin; center board on resize

Accounts for egui's 8px CentralPanel margin in the minimum window size.
When the window is larger than the minimum, the board is centered in the
available area.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 01:18:02 -05:00
parent f7e585f6ed
commit 37c10c7c38
2 changed files with 21 additions and 5 deletions
+5 -2
View File
@@ -1,5 +1,8 @@
use eframe::egui::Color32;
pub const BOARD_W: usize = 60;
pub const BOARD_H: usize = 25;
pub struct Glyph {
pub ch: char,
pub fg: Color32,
@@ -64,8 +67,8 @@ pub struct GameState {
impl GameState {
pub fn new() -> Self {
let w = 60;
let h = 25;
let w = BOARD_W;
let h = BOARD_H;
let mut board = Board {
width: w,