Skip to content

Commit

Permalink
♻️Do not center the wallpaper when not needed
Browse files Browse the repository at this point in the history
igorkulman committed Nov 1, 2022

Verified

This commit was signed with the committer’s verified signature.
igorkulman Igor Kulman
1 parent 27fb4ef commit 0e84be6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -74,6 +74,11 @@ extension NSImage {
return nil
}

// the image centering is needed only when the resized image does not exactly match the screen size
guard resized.size != size else {
return resized
}

// Get some points to center the cropping area.
let x = floor((resized.size.width - size.width) / 2)
let y = floor((resized.size.height - size.height) / 2)

0 comments on commit 0e84be6

Please sign in to comment.