[gnome-music/wip/mschraal/default-icon-cleanups: 5/24] defaulticon: Simplify cover scaling




commit 432afb57d9db28cfc8cfe43267a74b8a7e8b905c
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Aug 24 22:18:14 2021 +0200

    defaulticon: Simplify cover scaling

 gnomemusic/defaulticon.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/gnomemusic/defaulticon.py b/gnomemusic/defaulticon.py
index de693ee6b..c65c6bb19 100644
--- a/gnomemusic/defaulticon.py
+++ b/gnomemusic/defaulticon.py
@@ -83,11 +83,8 @@ def make_icon_frame(
         ctx.mask_surface(icon_surface, w / 3, h / 3)
         ctx.fill()
     else:
-        matrix = cairo.Matrix()
-        matrix.scale(icon_w / (w * scale), icon_h / (h * scale))
+        ctx.scale((w * scale) / icon_w, (h * scale) / icon_h)
         ctx.set_source_surface(icon_surface, 0, 0)
-        pattern = ctx.get_source()
-        pattern.set_matrix(matrix)
         ctx.fill()
 
     return surface


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