Consume widget during rendering
This commit is contained in:
parent
53a0f8d4af
commit
d3229370f3
2 changed files with 2 additions and 2 deletions
|
|
@ -7,5 +7,5 @@ use toss::frame::{Frame, Pos, Size};
|
|||
pub trait Widget {
|
||||
fn size(&self, frame: &mut Frame, max_width: Option<u16>, max_height: Option<u16>) -> Size;
|
||||
|
||||
async fn render(&self, frame: &mut Frame, pos: Pos, size: Size);
|
||||
async fn render(self, frame: &mut Frame, pos: Pos, size: Size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ impl Widget for Text {
|
|||
Size::new(min_width as u16, min_height as u16)
|
||||
}
|
||||
|
||||
async fn render(&self, frame: &mut Frame, pos: Pos, size: Size) {
|
||||
async fn render(self, frame: &mut Frame, pos: Pos, size: Size) {
|
||||
for (i, line) in self
|
||||
.wrapped(frame, Some(size.width))
|
||||
.into_iter()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue