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




commit 3e199a651c4bb7782a93b92a232cab632f5946d3
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]