From 289fdaf490a8ad295d09b1c237180bdb7ce95e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 7 Feb 2024 19:09:36 +0200 Subject: [PATCH] gtk4: Always draw a black background behind the video frame This makes sure that there is the same background behind the frame, no matter if black borders have to be added or not. Without this a frame that has transparency would change rendering depending on the layout. Part-of: --- video/gtk4/src/sink/paintable/imp.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/video/gtk4/src/sink/paintable/imp.rs b/video/gtk4/src/sink/paintable/imp.rs index 082c1f1d..45503eaa 100644 --- a/video/gtk4/src/sink/paintable/imp.rs +++ b/video/gtk4/src/sink/paintable/imp.rs @@ -142,12 +142,10 @@ impl PaintableImpl for Paintable { } } - if trans_x != 0.0 || trans_y != 0.0 { - snapshot.append_color( - &gdk::RGBA::BLACK, - &graphene::Rect::new(0f32, 0f32, width as f32, height as f32), - ); - } + snapshot.append_color( + &gdk::RGBA::BLACK, + &graphene::Rect::new(0f32, 0f32, width as f32, height as f32), + ); snapshot.translate(&graphene::Point::new(trans_x as f32, trans_y as f32)); snapshot.scale(scale_x as f32, scale_y as f32);