From 4408d45f7a70fe057ece299269cdb813fe47d04a Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:55:41 +0100 Subject: [PATCH] gpui: Always recompute layout on cache miss. --- crates/gpui/src/view.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/gpui/src/view.rs b/crates/gpui/src/view.rs index 6426ac4c32f05e0765f2b5ca3cdb81ee603edc6e..e485aa3e57525118ea777f402a44d7d45928c5b6 100644 --- a/crates/gpui/src/view.rs +++ b/crates/gpui/src/view.rs @@ -321,10 +321,7 @@ impl Element for AnyView { } } - let mut element = state - .element - .take() - .unwrap_or_else(|| (self.request_layout)(self, cx).1); + let mut element = (self.request_layout)(self, cx).1; element.draw(bounds.origin, bounds.size.into(), cx); state.cache_key = Some(ViewCacheKey {