mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-02-21 10:39:03 +01:00
fix(tui): now 38 errors from tests
This commit is contained in:
parent
8ca90b9aa0
commit
ecae2082ed
2 changed files with 6 additions and 5 deletions
|
|
@ -135,7 +135,9 @@ pub fn tui_teardown <W: Write> (backend: &mut CrosstermBackend<W>) -> Usually<()
|
|||
}
|
||||
|
||||
pub fn tui_resized <W: Write> (
|
||||
backend: &mut CrosstermBackend<W>, buffer: &mut Buffer, size: ratatui::prelude::Rect
|
||||
backend: &mut CrosstermBackend<W>,
|
||||
buffer: &mut Buffer,
|
||||
size: ratatui::prelude::Rect
|
||||
) {
|
||||
if buffer.area != size {
|
||||
backend.clear_region(ClearType::All).unwrap();
|
||||
|
|
|
|||
|
|
@ -16,10 +16,9 @@ impl Tui {
|
|||
/// Clean up after run
|
||||
pub fn teardown (&mut self) -> Usually<()> { tui_teardown(&mut self.backend) }
|
||||
/// Apply changes to the display buffer.
|
||||
pub fn flip (&mut self, mut new_buffer: Buffer, size: ratatui::prelude::Rect) -> Buffer {
|
||||
let Self { buffer, backend, .. } = self;
|
||||
tui_resized(&mut backend, &mut buffer, size);
|
||||
tui_redrawn(&mut backend, &mut buffer, &mut new_buffer);
|
||||
pub fn flip (&mut self, mut buffer: Buffer, size: ratatui::prelude::Rect) -> Buffer {
|
||||
tui_resized(&mut self.backend, &mut self.buffer, size);
|
||||
tui_redrawn(&mut self.backend, &mut self.buffer, &mut buffer);
|
||||
buffer
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue