Skip to content

Conversation

@NickEntin
Copy link
Collaborator

@NickEntin NickEntin commented Aug 30, 2024

Resolves #135

@NickEntin NickEntin requested a review from dfed August 30, 2024 22:44
Copy link
Collaborator

@dfed dfed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that'll save me some typing!

/// Returns the largest size that will fit within the specified available `width` and `height`, preserving the receiver's `image`'s aspect ratio.
///
/// If `allowUpscaling` is true, the returned size will be at most the image's native size. This is most commonly used when the `image` is a raster image and is not meant to be scaled up.
public func sizeThatFitsPreservingAspectRatio(width: CGFloat, height: CGFloat = .greatestFiniteMagnitude, allowingUpscaling: Bool) -> CGSize {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this technically maxWidth and maxHeight?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support sizing image views with aspect ratio preservation

3 participants