Skip to content

Fixed divide by 0 «NaN» crash#78

Open
nomadplanet wants to merge 1 commit intotomvanzummeren:masterfrom
nomadplanet:master
Open

Fixed divide by 0 «NaN» crash#78
nomadplanet wants to merge 1 commit intotomvanzummeren:masterfrom
nomadplanet:master

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