@@ -545,7 +545,7 @@ pub fn render_color_selection_popup(frame: &mut Frame, app: &App) {
545545 . constraints (
546546 [
547547 Constraint :: Ratio ( 1 , 3 ) ,
548- Constraint :: Ratio ( 1 , 3 ) ,
548+ Constraint :: Min ( 3 ) ,
549549 Constraint :: Ratio ( 1 , 3 ) ,
550550 ]
551551 . as_ref ( ) ,
@@ -565,7 +565,6 @@ pub fn render_color_selection_popup(frame: &mut Frame, app: &App) {
565565 . split ( inner_popup_layout_vertical[ 1 ] ) ;
566566
567567 let display_mode = & app. game . ui . display_mode ;
568- let piece_size = PieceSize :: from_dimensions ( inner_popup_layout_horizontal[ 0 ] . height ) ;
569568
570569 // White option: white pawn on black background (like a chess square)
571570 let white_selected = app. menu_cursor == 0 ;
@@ -580,10 +579,12 @@ pub fn render_color_selection_popup(frame: &mut Frame, app: &App) {
580579 let white_area = inner_popup_layout_horizontal[ 0 ] ;
581580 frame. render_widget ( white_block. clone ( ) , white_area) ;
582581
582+ let white_inner_area = white_block. inner ( white_area) ;
583+ let piece_size = PieceSize :: from_dimensions ( white_inner_area. height ) ;
584+
583585 // Render background only in the inner area (inside the border)
584586 if white_selected {
585- let inner_area = white_block. inner ( white_area) ;
586- render_cell ( frame, inner_area, Color :: Black , None ) ;
587+ render_cell ( frame, white_inner_area, Color :: Black , None ) ;
587588 }
588589
589590 let white_pawn = Paragraph :: new ( Pawn :: to_string (
@@ -607,7 +608,7 @@ pub fn render_color_selection_popup(frame: &mut Frame, app: &App) {
607608 Modifier :: empty ( )
608609 } ) ,
609610 ) ;
610- frame. render_widget ( white_pawn, white_block . inner ( white_area ) ) ;
611+ frame. render_widget ( white_pawn, white_inner_area ) ;
611612
612613 // Black option: black pawn on white background (like a chess square)
613614 let black_selected = app. menu_cursor == 1 ;
@@ -622,15 +623,17 @@ pub fn render_color_selection_popup(frame: &mut Frame, app: &App) {
622623 let black_area = inner_popup_layout_horizontal[ 2 ] ;
623624 frame. render_widget ( black_block. clone ( ) , black_area) ;
624625
626+ let black_inner_area = black_block. inner ( black_area) ;
627+ let black_piece_size = PieceSize :: from_dimensions ( black_inner_area. height ) ;
628+
625629 // Render background only in the inner area (inside the border)
626630 if black_selected {
627- let inner_area = black_block. inner ( black_area) ;
628- render_cell ( frame, inner_area, Color :: White , None ) ;
631+ render_cell ( frame, black_inner_area, Color :: White , None ) ;
629632 }
630633
631634 let black_pawn = Paragraph :: new ( Pawn :: to_string (
632635 display_mode,
633- piece_size ,
636+ black_piece_size ,
634637 Some ( ShakmatyColor :: Black ) ,
635638 ) )
636639 . block ( Block :: default ( ) )
@@ -649,7 +652,7 @@ pub fn render_color_selection_popup(frame: &mut Frame, app: &App) {
649652 Modifier :: empty ( )
650653 } ) ,
651654 ) ;
652- frame. render_widget ( black_pawn, black_block . inner ( black_area ) ) ;
655+ frame. render_widget ( black_pawn, black_inner_area ) ;
653656
654657 // Labels under each option to make the choice explicit and readable on any theme
655658 let label_layout_horizontal = Layout :: default ( )
0 commit comments