mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1452>
This commit is contained in:
parent
803550111a
commit
9971f71e94
1 changed files with 4 additions and 6 deletions
|
@ -144,12 +144,10 @@ impl PaintableImpl for Paintable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if trans_x != 0.0 || trans_y != 0.0 {
|
snapshot.append_color(
|
||||||
snapshot.append_color(
|
&gdk::RGBA::BLACK,
|
||||||
&gdk::RGBA::BLACK,
|
&graphene::Rect::new(0f32, 0f32, width as f32, height as f32),
|
||||||
&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.translate(&graphene::Point::new(trans_x as f32, trans_y as f32));
|
||||||
snapshot.scale(scale_x as f32, scale_y as f32);
|
snapshot.scale(scale_x as f32, scale_y as f32);
|
||||||
|
|
Loading…
Reference in a new issue