From 523a46b4f561e2dfac05158e489585d2a37ab5e8 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 15 Mar 2024 12:59:52 +0100 Subject: [PATCH] gtk4: scale texture position Fix regression in 0.12 introduced by 3423d05f77ae08787c0b3d188e372cf3ce16c913 Code from Ivan Molodetskikh suggested on Matrix. Fix #519 Part-of: --- video/gtk4/src/sink/paintable/imp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/gtk4/src/sink/paintable/imp.rs b/video/gtk4/src/sink/paintable/imp.rs index 1ce38dfa..eccff6b8 100644 --- a/video/gtk4/src/sink/paintable/imp.rs +++ b/video/gtk4/src/sink/paintable/imp.rs @@ -220,7 +220,9 @@ impl PaintableImpl for Paintable { 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); + let x = *x * scale_x as f32; + let y = *y * 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. //