summaryrefslogtreecommitdiffstats
path: root/widget/src/lazy/component.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-10 01:14:39 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-10 01:14:39 +0200
commit1af5ff41abdef243588199ef7988666655924a02 (patch)
tree4dfd518dd93b0393e77355867062c60d75e7f358 /widget/src/lazy/component.rs
parenta3489e4af960388e9f73988b88df361022a654a4 (diff)
parent1cc5bf59d7c4f47ae47d9a4e22ebaab3ea4975c1 (diff)
downloadiced-1af5ff41abdef243588199ef7988666655924a02.tar.gz
iced-1af5ff41abdef243588199ef7988666655924a02.tar.bz2
iced-1af5ff41abdef243588199ef7988666655924a02.zip
Merge pull request #2058 from iced-rs/explicit-text-caching
Explicit text caching
Diffstat (limited to 'widget/src/lazy/component.rs')
-rw-r--r--widget/src/lazy/component.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/widget/src/lazy/component.rs b/widget/src/lazy/component.rs
index 19df2792..fe99a7f2 100644
--- a/widget/src/lazy/component.rs
+++ b/widget/src/lazy/component.rs
@@ -254,11 +254,18 @@ where
fn layout(
&self,
+ tree: &mut Tree,
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
+ let t = tree.state.downcast_mut::<Rc<RefCell<Option<Tree>>>>();
+
self.with_element(|element| {
- element.as_widget().layout(renderer, limits)
+ element.as_widget().layout(
+ &mut t.borrow_mut().as_mut().unwrap().children[0],
+ renderer,
+ limits,
+ )
})
}
@@ -566,7 +573,7 @@ where
S: 'static + Default,
{
fn layout(
- &self,
+ &mut self,
renderer: &Renderer,
bounds: Size,
position: Point,