Skip to content

Commit

Permalink
gpui: Replace redundant code in animation (#19273)
Browse files Browse the repository at this point in the history
Just a small change to replace some redundant code in the animation
element.

Release Notes:

- N/A
  • Loading branch information
MatinAniss authored Oct 16, 2024
1 parent 7a5003b commit 879a2ea
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/gpui/src/elements/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 879a2ea

Please sign in to comment.