Describe the goal of this PR. Mention any related Issue numbers.
This PR fixes a crash seen when the result of CGFloat(bounds.height - config.paddingInsets.top - config.paddingInsets.bottom) / CGFloat(requiredSpaceForEachLine) is 0
Applying round to 0 results in NaN which crashes the runtime when converting to Int
call .showAnimatedGradientSkeleton() [or I am assuming any of the .show methods]
In our app we dynamically resize a text view depending if there is text within, it might be notable that the text view is embedded in a stackView, but I assume the crash would happen either way if the view size is 0.
Requirements (place an x in each of the [ ])
[x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
Summary
Describe the goal of this PR. Mention any related Issue numbers.
This PR fixes a crash seen when the result of
CGFloat(bounds.height - config.paddingInsets.top - config.paddingInsets.bottom) / CGFloat(requiredSpaceForEachLine)
is0
Applying
round
to0
results inNaN
which crashes the runtime when converting toInt
https://www.dropbox.com/s/u9id3amj27370bw/Screen%20Shot%202021-04-09%20at%203.04.05%20PM.png?dl=0
Steps to reproduce:
.showAnimatedGradientSkeleton()
[or I am assuming any of the .show methods]In our app we dynamically resize a text view depending if there is text within, it might be notable that the text view is embedded in a stackView, but I assume the crash would happen either way if the view size is 0.
Requirements (place an
x
in each of the[ ]
)