From f5a82152394fde4d8f740f664ab7737b82861618 Mon Sep 17 00:00:00 2001 From: cashmere Date: Tue, 28 Jul 2026 19:41:16 +0200 Subject: feat: GPUI desktop port foundation - scene crate: full project/scene/element model, serde round-trip proven against the web SerializedProject shape - transfer crate: .ocp zip container, cross-compat with web fflate archives proven in both directions - storage crate: filesystem project store replacing IndexedDB, .ocp import/export - media crate: ffmpeg-next 8 decoder (frames, audio, thumbnails, waveform summaries) - playback crate: wall-clock anchored, frame-rounded playback clock - gpu crate: native texture readback; compositor renders headless offscreen on Vulkan (spike test) - flake devshell: rust toolchain, GPUI native deps, ffmpeg dev, bindgen clang args; GPUI hello-world builds - port plan in notes/gpui-port.md --- rust/crates/timeline/src/placement/overlap.rs | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 rust/crates/timeline/src/placement/overlap.rs (limited to 'rust/crates/timeline/src/placement/overlap.rs') diff --git a/rust/crates/timeline/src/placement/overlap.rs b/rust/crates/timeline/src/placement/overlap.rs new file mode 100644 index 00000000..98055e9a --- /dev/null +++ b/rust/crates/timeline/src/placement/overlap.rs @@ -0,0 +1,34 @@ +use scene::Element; +use time::MediaTime; + +use super::PlacementTimeSpan; + +fn would_element_overlap( + elements: &[Element], + start_time: MediaTime, + end_time: MediaTime, + exclude_element_id: Option<&str>, +) -> bool { + elements.iter().any(|element| { + if exclude_element_id == Some(element.base().id.as_str()) { + return false; + } + + let element_end = element.base().start_time + element.base().duration; + start_time < element_end && end_time > element.base().start_time + }) +} + +pub fn can_place_time_spans_on_track( + elements: &[Element], + time_spans: &[PlacementTimeSpan], +) -> bool { + time_spans.iter().all(|span| { + !would_element_overlap( + elements, + span.start_time, + span.start_time + span.duration, + span.exclude_element_id.as_deref(), + ) + }) +} -- cgit v1.3.1