Add comment about the duplicate work in widget.height()
This commit is contained in:
@ -130,6 +130,12 @@ impl Backlog {
|
|||||||
}) if *key == text_area.width => *height,
|
}) if *key == text_area.width => *height,
|
||||||
prerender => {
|
prerender => {
|
||||||
let widget = self.build_widget(item.content.clone(), 0);
|
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);
|
let expected_height = widget.height(text_area.width);
|
||||||
*prerender = Some(PrerenderInner {
|
*prerender = Some(PrerenderInner {
|
||||||
key: text_area.width,
|
key: text_area.width,
|
||||||
|
Reference in New Issue
Block a user