diff --git a/src/components/backlog.rs b/src/components/backlog.rs index b80e627..b8a6112 100644 --- a/src/components/backlog.rs +++ b/src/components/backlog.rs @@ -130,6 +130,12 @@ impl Backlog { }) if *key == text_area.width => *height, prerender => { let widget = self.build_widget(item.content.clone(), 0); + // widget.height() needs to run the whole word-wrapping, which is almost as + // expensive as the real render. + // This is particularly wasteful, as the last widget.height() call here will + // duplicate the work we do in widget.render_overlap() later in the loop. + // Unfortunately I can't find a way to make it work because of the lifetimes + // involved. let expected_height = widget.height(text_area.width); *prerender = Some(PrerenderInner { key: text_area.width,