gears.wallpaper: Make code more readable
by introducing some extra variables that server as some documentation. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
1942986468
commit
0dc6b7f724
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue