perf(ui-gpui): throttle pulse to 5fps via spawn+timer instead of request_animation_frame
This commit is contained in:
parent
c4d0707514
commit
713b53ba0c
2 changed files with 32 additions and 15 deletions
|
|
@ -96,8 +96,10 @@ impl ProjectBox {
|
|||
AgentStatus::Done => DotStatus::Done,
|
||||
AgentStatus::Error => DotStatus::Error,
|
||||
};
|
||||
let status_dot = cx.new(|_cx: &mut Context<PulsingDot>| {
|
||||
PulsingDot::new(dot_status, 8.0)
|
||||
let status_dot = cx.new(|cx: &mut Context<PulsingDot>| {
|
||||
let dot = PulsingDot::new(dot_status, 8.0);
|
||||
dot.start_throttled_animation(cx);
|
||||
dot
|
||||
});
|
||||
self.status_dot = Some(status_dot);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue