generated from GarandPLG/rust-flake-template
Replace scrollbar state with simple offset struct
Introduce Offset type to track scroll positions and replace ScrollbarState fields in SkirmishState Update keybindings, App::draw, Widget impl, and BoardWidget::new to use mutable references and the new Offset struct. Adjust imports accordingly.
This commit is contained in:
@@ -11,7 +11,7 @@ use ratatui::{
|
||||
widgets::{Block, Borders, Padding, Paragraph, Widget},
|
||||
};
|
||||
|
||||
pub fn skirmish_view(app: &App, area: Rect, buf: &mut Buffer) {
|
||||
pub fn skirmish_view(app: &mut App, area: Rect, buf: &mut Buffer) {
|
||||
let vertical_layout: Layout = Layout::vertical([
|
||||
Constraint::Length(4),
|
||||
Constraint::Fill(1),
|
||||
@@ -70,7 +70,7 @@ pub fn skirmish_view(app: &App, area: Rect, buf: &mut Buffer) {
|
||||
board_block.render(main_area, buf);
|
||||
|
||||
let cells_area: Rect = board_area.inner(Margin {
|
||||
horizontal: 1,
|
||||
horizontal: 3,
|
||||
vertical: 1,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user