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:
@@ -32,7 +32,10 @@ struct TimelineView: View {
|
|||||||
guard offset >= 0 else {
|
guard offset >= 0 else {
|
||||||
return
|
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 {
|
var realtime_bar_opacity: Double {
|
||||||
|
|||||||
Reference in New Issue
Block a user