1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-11-11 01:42:35 +03:00

Fix image's aspect fitting logic

This commit is contained in:
Alisa Mylnikova 2018-06-09 14:44:38 +07:00
parent 4287c5ee1d
commit 230f6dd41f

View File

@ -97,8 +97,8 @@ class ImageRenderer: NodeRenderer {
}
let newSize = image.aspectRatio.fit(
size: Size(w: Double(image.w), h: Double(image.h)),
into: Size(w: Double(imageSize.width), h: Double(imageSize.height))
size: Size(w: Double(imageSize.width), h: Double(imageSize.height)),
into: Size(w: w.doubleValue, h: h.doubleValue)
)
let destX = image.xAlign.align(outer: w.doubleValue, inner: newSize.w)
let destY = image.yAlign.align(outer: h.doubleValue, inner: newSize.h)