gpui: Always recompute layout on cache miss. (#4131)

Max Brunsfeld created

I'm not yet sure whether this is 100% correct, but it seems to alleviate
the following issue:
`When opening a dock, the panel doesn't appear right away. An empty dock
is briefly visible.`
Release Notes:

- Fixed panel layout being incorrect for a brief time after opening
(fixes https://github.com/zed-industries/community/issues/2415)

Change summary

crates/gpui/src/view.rs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

Detailed changes

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 {