diff --git a/Sources/Generator/Extensions/NSSize+Extensions.swift b/Sources/Generator/Extensions/NSSize+Extensions.swift index 603b8fd..9018311 100644 --- a/Sources/Generator/Extensions/NSSize+Extensions.swift +++ b/Sources/Generator/Extensions/NSSize+Extensions.swift @@ -12,7 +12,7 @@ extension NSSize { return self } - let height = height * desiredWidth / width + let height = (height * desiredWidth / width).rounded(.down) return NSSize(width: desiredWidth, height: height) } } diff --git a/Sources/Generator/Files/FileSystem.swift b/Sources/Generator/Files/FileSystem.swift index 839c702..ca1ec0b 100644 --- a/Sources/Generator/Files/FileSystem.swift +++ b/Sources/Generator/Files/FileSystem.swift @@ -316,7 +316,7 @@ final class FileSystem { let scaledImage = sourceImage.scaledDown(to: destinationSize) let scaledSize = scaledImage.size - if abs(scaledImage.size.width - desiredWidth) > 2 { + if abs(scaledSize.width - desiredWidth) > 2 { log.add(warning: "Desired width \(desiredWidth), got \(scaledSize.width)", source: destination) } if abs(destinationSize.height - scaledImage.size.height) > 2 {