Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Replace redundant code in animation (#19273)

Matin Aniss879a2ea06f41
diff --git a/crates/gpui/src/elements/animation.rs b/crates/gpui/src/elements/animation.rs
index daa11984965..bffa52cfbaf 100644
--- a/crates/gpui/src/elements/animation.rs
+++ b/crates/gpui/src/elements/animation.rs
@@ -133,14 +133,7 @@ impl<E: IntoElement + 'static> Element for AnimationElement<E> {
let mut element = (self.animator)(element, delta).into_any_element();
if !done {
- let parent_id = cx.parent_view_id();
- cx.on_next_frame(move |cx| {
- if let Some(parent_id) = parent_id {
- cx.notify(parent_id)
- } else {
- cx.refresh()
- }
- })
+ cx.request_animation_frame();
}
((element.request_layout(cx), element), state)