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:
+5
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user