Fix rendering when resizing
This commit is contained in:
parent
15f628aaad
commit
5210ad1eba
1 changed files with 2 additions and 1 deletions
|
|
@ -139,11 +139,11 @@ impl Ui {
|
||||||
Some(event) => event,
|
Some(event) => event,
|
||||||
None => return Ok(()),
|
None => return Ok(()),
|
||||||
};
|
};
|
||||||
terminal.autoresize()?;
|
|
||||||
loop {
|
loop {
|
||||||
// Render in-between events so the next event is handled in an
|
// Render in-between events so the next event is handled in an
|
||||||
// up-to-date state. The results of these intermediate renders
|
// up-to-date state. The results of these intermediate renders
|
||||||
// will be thrown away before the final render.
|
// will be thrown away before the final render.
|
||||||
|
terminal.autoresize()?;
|
||||||
self.widget().await.render(terminal.frame()).await;
|
self.widget().await.render(terminal.frame()).await;
|
||||||
|
|
||||||
let result = match event {
|
let result = match event {
|
||||||
|
|
@ -167,6 +167,7 @@ impl Ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Render and present final state
|
// 3. Render and present final state
|
||||||
|
terminal.autoresize()?;
|
||||||
terminal.frame().reset();
|
terminal.frame().reset();
|
||||||
self.widget().await.render(terminal.frame()).await;
|
self.widget().await.render(terminal.frame()).await;
|
||||||
terminal.present()?;
|
terminal.present()?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue