mirror of
https://github.com/SvenTiigi/WhatsNewKit.git
synced 2026-04-02 23:58:58 -06:00
Aspect ratio not preserved when using fixed imageSize #62
Labels
No labels
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
question
question
question
question
question
question
question
question
question
question
question
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github/WhatsNewKit#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AndrewBennet on 6/11/2020
WhatsNewKit Environment
What did you do?
Configured a WhatsNew.Item with an image from the iOS 13 SFSymbol library.
What did you expect to happen?
I expected the aspect ratio of the image to be preserved, especially as
WhatsNewViewController.ItemsView.ImageSize.fixedis documented as/// A fixed height by keeping the aspect ratio.What happened instead?
The image was stretched into a square.
--
Example code:
If I alter to code to set
.originalas the image size, the image is no longer distorted but I then do not have a nice way to ensure that the images are equal width to make them align, and so the text of each item don't have aligning leading margins:It would seem that the resizing code in WhatsNewItemsViewController+Cell.swift, line 207,
func resize(height: CGFloat) -> UIImage?doesn't do as its comment says:/// Resize UIImage to a give height by keeping the aspect ratio.