Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed divide by 0 «NaN» crash #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed divide by 0 «NaN» crash #78

wants to merge 1 commit into from

Conversation

nomadplanet
Copy link

If the distribution is set to FillProportionally and all arranged subviews have their total size equal 0 (typical example is there's a single arrangedSubview which intrinsicContentSize is CGSizeZero), we have a crash later when creating the constraints

let multiplier = arrangedSubview.intrinsicContentSize().width / totalSize constraints.append(constraint(item: arrangedSubview, attribute: .Width, toItem: self, multiplier: multiplier, priority: priority))

multiplier is NaN and we have a crash creating the constraint.

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.

2 participants