From 3423d05f77ae08787c0b3d188e372cf3ce16c913 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 22 Aug 2023 10:20:22 +0400 Subject: [PATCH] gtk4: Do scaling with append_texture() This is equivalent, but will be needed for the scaling filter support. Part-of: --- video/gtk4/src/sink/paintable/imp.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/video/gtk4/src/sink/paintable/imp.rs b/video/gtk4/src/sink/paintable/imp.rs index 243350b0..49b2c268 100644 --- a/video/gtk4/src/sink/paintable/imp.rs +++ b/video/gtk4/src/sink/paintable/imp.rs @@ -177,7 +177,6 @@ impl PaintableImpl for Paintable { ); snapshot.translate(&graphene::Point::new(trans_x as f32, trans_y as f32)); - snapshot.scale(scale_x as f32, scale_y as f32); for Texture { texture, @@ -191,7 +190,9 @@ impl PaintableImpl for Paintable { { snapshot.push_opacity(*global_alpha as f64); - let bounds = graphene::Rect::new(*x, *y, *paintable_width, *paintable_height); + let texture_width = *paintable_width * scale_x as f32; + let texture_height = *paintable_height * scale_y as f32; + let bounds = graphene::Rect::new(*x, *y, texture_width, texture_height); // Only premultiply GL textures that expect to be in premultiplied RGBA format. //