From 104bfd5d2553ac86003f49224c146d0d2d9e1207 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Wed, 23 Feb 2022 22:12:56 +0100 Subject: [PATCH] Fix thumbnail scale --- src/preferences/BackgroundButton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preferences/BackgroundButton.js b/src/preferences/BackgroundButton.js index d362b6b..cc7f480 100644 --- a/src/preferences/BackgroundButton.js +++ b/src/preferences/BackgroundButton.js @@ -108,7 +108,7 @@ var BackgroundButton = GObject.registerClass({ return null; const pixbuf = GdkPixbuf.Pixbuf.new_from_file(path); - const scale = (width > height ? width : height) / (pixbuf.width > pixbuf.height ? pixbuf.height : pixbuf.width); + const scale = pixbuf.width / pixbuf.height > width / height ? height / pixbuf.height : width / pixbuf.width; const thumbPixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.GDK_COLORSPACE_RGB, pixbuf.has_alpha, pixbuf.bits_per_sample, width, height); pixbuf.scale( thumbPixbuf,