Closed AndrewBennet closed 4 years ago
This seems like a great project though, thanks for making it! I'm hoping to add it in to my app Reading List, but I'd much rather use iOS 13 SFSymbols than have to source my own images. I can use the original size setting, but the non-aligning text bugs me.
Hey @AndrewBennet
Thank you for your detailed bug report. I will investigate the reported bug and respond back if a fix is available ✌️
Hi Sven -- I've had a quite go at improving this, and submitted the change as a pull request: https://github.com/SvenTiigi/WhatsNewKit/pull/42
Running the example app with the images swapped out for SFSymbol images, I see better results now: no distorted images, and no misaligned text.
@AndrewBennet your PR (https://github.com/SvenTiigi/WhatsNewKit/pull/42) has been merged and a new release of WhatsNewKit is now available 1.3.4
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.fixed
is 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
.original
as 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
.