TZStackView icon indicating copy to clipboard operation
TZStackView copied to clipboard

Fixed divide by 0 «NaN» crash

Open nomadplanet opened this issue 8 years ago • 0 comments

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.

nomadplanet avatar Apr 14 '16 14:04 nomadplanet