diff --git a/lib/gears/wallpaper.lua.in b/lib/gears/wallpaper.lua.in index e3e41ac16..2f07b98e1 100644 --- a/lib/gears/wallpaper.lua.in +++ b/lib/gears/wallpaper.lua.in @@ -139,7 +139,9 @@ function wallpaper.maximized(surf, s, ignore_aspect, offset) if offset then cr:translate(offset.x, offset.y) elseif not ignore_aspect then - cr:translate(((geom.width / aspect_w) - w) / 2, ((geom.height / aspect_h) - h) / 2) + local scaled_width = geom.width / aspect_w + local scaled_height = geom.height / aspect_h + cr:translate((scaled_width - w) / 2, (scaled_height - h) / 2) end cr:set_source_surface(surf, 0, 0)