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:
parent
4287c5ee1d
commit
230f6dd41f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user