[fractal/fractal-next] QrCodeScanner: Remove unnecessary clip



commit b4a35372fe4fb0c00eec6ecc5e1fa7b969ccf0ad
Author: Julian Sparber <julian sparber net>
Date:   Mon Dec 6 17:16:13 2021 +0100

    QrCodeScanner: Remove unnecessary clip
    
    Backport of https://gitlab.gnome.org/World/decoder/-/commit/24bf94be64814f76d8b3771f65b88d2170fc99ba

 src/contrib/qr_code_scanner/camera_paintable.rs | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/src/contrib/qr_code_scanner/camera_paintable.rs b/src/contrib/qr_code_scanner/camera_paintable.rs
index 3dacb29c..e4d7c9b1 100644
--- a/src/contrib/qr_code_scanner/camera_paintable.rs
+++ b/src/contrib/qr_code_scanner/camera_paintable.rs
@@ -293,15 +293,11 @@ mod imp {
             let snapshot = snapshot.downcast_ref::<gtk::Snapshot>().unwrap();
 
             if let Some(ref image) = *self.image.borrow() {
-                // Transformation to avoid stretching the camera. We translate and scale the image
-                // under a clip.
-                let clip = graphene::Rect::new(0.0, 0.0, width as f32, height as f32);
+                // Transformation to avoid stretching the camera. We translate and scale the image.
 
                 let aspect = width / height.max(std::f64::EPSILON); // Do not divide by zero.
                 let image_aspect = image.intrinsic_aspect_ratio();
 
-                snapshot.push_clip(&clip);
-
                 if image_aspect == 0.0 {
                     image.snapshot(snapshot.upcast_ref(), width, height);
                     return;
@@ -319,8 +315,6 @@ mod imp {
                 snapshot.translate(&p);
 
                 image.snapshot(snapshot.upcast_ref(), new_width, new_height);
-
-                snapshot.pop();
             } else {
                 snapshot.append_color(
                     &gdk::RGBA::black(),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]