From 0dc6b7f7246e7bab87c8a3065d482b85c2d31dd0 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 24 Aug 2014 11:54:12 +0200 Subject: [PATCH] gears.wallpaper: Make code more readable by introducing some extra variables that server as some documentation. Signed-off-by: Uli Schlachter --- lib/gears/wallpaper.lua.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)