mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
fix: update_dimension not updating dimensions
This commit is contained in:
@@ -290,6 +290,8 @@ impl Board {
|
|||||||
|
|
||||||
/// Updates dimensions of graphical squares
|
/// Updates dimensions of graphical squares
|
||||||
pub fn update_dimensions(&mut self) {
|
pub fn update_dimensions(&mut self) {
|
||||||
|
self.field_size = self.rect.w / self.board_view.size as f32;
|
||||||
|
|
||||||
for field in &mut self.fields {
|
for field in &mut self.fields {
|
||||||
let pos: Position = field.pos;
|
let pos: Position = field.pos;
|
||||||
|
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ impl GameClient {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if self.board.update_board_rect(self.board_area) {
|
if self.board.update_board_rect(self.board_area) {
|
||||||
self.board.repopulate();
|
self.board.update_dimensions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user