Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Merge pull request #2599 from colinvkim/perf/gpui-zoom-cluster-lookup

Richie McIlroyd75f5dd114d1
diff --cc crates/rendering/src/zoom_spring.rs
index 666b1c1c5,a8ddaab2c..0dee58234
--- a/crates/rendering/src/zoom_spring.rs
+++ b/crates/rendering/src/zoom_spring.rs
@@@ -424,23 -454,9 +456,9 @@@ pub(crate) fn build_clusters
clusters
}
- /// The active cluster at `time_ms` (RECORDING time) is the last cluster whose
- /// first event time is <= t; the spring smooths the discrete re-aims.
- pub(crate) fn cluster_center_at_time(
- clusters: &[ClickCluster],
- time_ms: f64,
- ) -> Option<(f64, f64)> {
- clusters
- .iter()
- .rev()
- .find(|c| c.start_time_ms <= time_ms)
- .or_else(|| clusters.first())
- .map(|c| c.center())
- }
-
/// One entry of the timeline-time -> recording-time mapping derived from
/// [`TimelineConfiguration::get_segment_time`]'s accumulation logic.
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, PartialEq)]
struct TimeMapSegment {
timeline_start: f64,
timeline_end: f64,