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




commit 4fbc2991e9431ad7dbbb0e999804ff5119b2271d
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 3010dc65a..b5f9641ef 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]