generated from GarandPLG/rust-flake-template
Adjust board vertical offset and focus
This commit is contained in:
@@ -34,12 +34,13 @@ impl BoardState {
|
|||||||
let v_max_offset: usize = Self::max_offset(map_height, rows);
|
let v_max_offset: usize = Self::max_offset(map_height, rows);
|
||||||
let h_max_offset: usize = Self::max_offset(map_width, cols);
|
let h_max_offset: usize = Self::max_offset(map_width, cols);
|
||||||
|
|
||||||
let vertical_offset: Offset =
|
let vertical_offset: Offset = Offset::new(
|
||||||
Offset::new(Some((map_height - rows as usize) / 2), Some(v_max_offset));
|
Some((map_height - rows as usize) / 2 + 1),
|
||||||
|
Some(v_max_offset),
|
||||||
|
);
|
||||||
let horizontal_offset: Offset = Offset::new(None, Some(h_max_offset));
|
let horizontal_offset: Offset = Offset::new(None, Some(h_max_offset));
|
||||||
|
|
||||||
let focused_cell: FocusedCell =
|
let focused_cell: FocusedCell = FocusedCell::new(map_height / 2, 2, map_height, map_width);
|
||||||
FocusedCell::new((map_height / 2) - 1, 2, map_height, map_width);
|
|
||||||
|
|
||||||
let mut cells: Vec<Vec<CellWidget>> = Vec::new();
|
let mut cells: Vec<Vec<CellWidget>> = Vec::new();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user