Commit 8c960f78 authored by Erik Reider's avatar Erik Reider

Fix MPRIS image scaling when display is scaled

parent f765d2d4
...@@ -225,8 +225,8 @@ namespace SwayNotificationCenter { ...@@ -225,8 +225,8 @@ namespace SwayNotificationCenter {
Cairo.Surface scale_surf = Gdk.cairo_surface_create_from_pixbuf (pixbuf, Cairo.Surface scale_surf = Gdk.cairo_surface_create_from_pixbuf (pixbuf,
img_scale, img_scale,
null); null);
int width = pixbuf.width; int width = pixbuf.width / img_scale;
int height = pixbuf.height; int height = pixbuf.height / img_scale;
double window_ratio = (double) buffer_width / buffer_height; double window_ratio = (double) buffer_width / buffer_height;
double bg_ratio = width / height; double bg_ratio = width / height;
if (window_ratio > bg_ratio) { // Taller wallpaper than monitor if (window_ratio > bg_ratio) { // Taller wallpaper than monitor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment