Fix issue where CPU is continuously pegged when scrolling

Since should_queue is continuosly getting set, this is causing the
InnerTimelineView to continuously rerender, pegging the CPU to 100%

This change only updates the var if it changes from the previous value.
This commit is contained in:
William Casarin
2023-02-21 05:06:59 -08:00
parent b1a2b47116
commit 37b964c296

View File

@@ -32,7 +32,10 @@ struct TimelineView: View {
guard offset >= 0 else {
return
}
self.events.should_queue = offset > 0
let val = offset > 0
if self.events.should_queue != val {
self.events.should_queue = val
}
}
var realtime_bar_opacity: Double {