From 9861de3c299be771c29a3aaee169cf20e9a75dbb Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 23 Oct 2026 17:11:34 -0400 Subject: [PATCH] Media: a negative (padding) video crop keeps the letterboxed frame The format repair clamps a crop to 0..1, but an unrepaired negative value still took the stretch path in paint_frame (CodeRabbit on #1008). Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/media.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/media.rs b/crates/ui-egui/src/media.rs index 9862c22d..fc23902a 100644 --- a/crates/ui-egui/src/media.rs +++ b/crates/ui-egui/src/media.rs @@ -415,7 +415,7 @@ fn crop_uv(crop: [f64; 4]) -> Rect { /// the video is cropped, the cropped part stretched over the whole box as PowerPoint shows it. pub fn paint_frame(painter: &egui::Painter, host: &MediaHost, id: ShapeId, rect: Rect, crop: [f64; 4]) -> bool { let Some(tex) = host.texture(id) else { return false }; - if crop.iter().any(|v| *v != 0.0) { + if crop.iter().any(|v| *v > 0.0) { painter.rect_filled(rect, CornerRadius::ZERO, Color32::BLACK); painter.image(tex.id(), rect, crop_uv(crop), Color32::WHITE); return true;