Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Ignore cursor for manual zoom-out boundaries
Richie McIlroy4d977f0277b6
diff --git a/crates/rendering/src/zoom.rs b/crates/rendering/src/zoom.rsindex f70fe9c84..b4cc391c3 100644--- a/crates/rendering/src/zoom.rs+++ b/crates/rendering/src/zoom.rs@@ -271,7 +271,7 @@ impl InterpolatedZoom {let cursor_for_bounds = if is_auto_zoom_out {segment_end_cursor.or(actual_cursor)} else {- actual_cursor+ None};if is_auto_zoom_out {@@ -1088,6 +1088,43 @@ mod test {);}+ #[test]+ fn manual_zoom_out_boundary_ignores_cursor_position() {+ let segments = vec![test_segment(2.0, 4.0, 4.0, 0.9, 0.1)];+ let cursor = Coord::<RawDisplayUVSpace>::new(XY::new(0.5, 0.5));++ let at_boundary = InterpolatedZoom::new_with_easing_and_cursor(+ c(4.0, &segments),+ Default::default(),+ Some(cursor),+ None,+ None,+ |t| t,+ |t| t,+ );++ let just_after = InterpolatedZoom::new_with_easing_and_cursor(+ c(4.0 + 1e-9, &segments),+ Default::default(),+ Some(cursor),+ None,+ None,+ |t| t,+ |t| t,+ );++ let dx_tl = (just_after.bounds.top_left.x - at_boundary.bounds.top_left.x).abs();+ let dy_tl = (just_after.bounds.top_left.y - at_boundary.bounds.top_left.y).abs();+ let dx_br = (just_after.bounds.bottom_right.x - at_boundary.bounds.bottom_right.x).abs();+ let dy_br = (just_after.bounds.bottom_right.y - at_boundary.bounds.bottom_right.y).abs();++ let max_jump = dx_tl.max(dy_tl).max(dx_br).max(dy_br);+ assert!(+ max_jump < 1e-4,+ "Manual zoom-out jumped {max_jump} toward cursor at segment boundary"+ );+ }+#[test]fn zoom_out_early_frames_are_smooth() {let segments = vec![test_segment(2.0, 4.0, 2.0, 0.5, 0.5)];