From 9971f71e94aa47cd4a116daaf357e9cf3fab9d45 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 d051d42f..ee6a454f 100644 --- a/video/gtk4/src/sink/paintable/imp.rs +++ b/video/gtk4/src/sink/paintable/imp.rs @@ -144,12 +144,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);