mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 00:52:31 +03:00
Reuse layout for view's element when it wasn't cached
This commit is contained in:
parent
a4a0a02dc3
commit
9446e573e9
@ -321,8 +321,12 @@ impl Element for AnyView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut element = (self.request_layout)(self, cx).1;
|
if let Some(mut element) = state.element.take() {
|
||||||
element.draw(bounds.origin, bounds.size.into(), cx);
|
element.paint(cx);
|
||||||
|
} else {
|
||||||
|
let mut element = (self.request_layout)(self, cx).1;
|
||||||
|
element.draw(bounds.origin, bounds.size.into(), cx);
|
||||||
|
}
|
||||||
|
|
||||||
state.cache_key = Some(ViewCacheKey {
|
state.cache_key = Some(ViewCacheKey {
|
||||||
bounds,
|
bounds,
|
||||||
|
Loading…
Reference in New Issue
Block a user