Skip to content

Commit 0e84be6

Browse files
committed
♻️Do not center the wallpaper when not needed
1 parent 27fb4ef commit 0e84be6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/ChangeMenuBarColor/Extensions/NSImage+Extensions.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ extension NSImage {
7474
return nil
7575
}
7676

77+
// the image centering is needed only when the resized image does not exactly match the screen size
78+
guard resized.size != size else {
79+
return resized
80+
}
81+
7782
// Get some points to center the cropping area.
7883
let x = floor((resized.size.width - size.width) / 2)
7984
let y = floor((resized.size.height - size.height) / 2)

0 commit comments

Comments
 (0)