mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-15 11:40:37 +00:00
fix divide by zero
This commit is contained in:
parent
90a2a19bb1
commit
8cf4005bf1
|
@ -197,6 +197,8 @@ struct DefaultPreviewImage: View {
|
|||
}
|
||||
|
||||
private func calculateSize(_ proposal: ProposedViewSize) -> CGSize {
|
||||
guard originalWidth > 0 else { return CGSize.zero }
|
||||
|
||||
return switch (proposal.width, proposal.height) {
|
||||
case (nil, nil):
|
||||
CGSize(width: originalWidth, height: originalWidth)
|
||||
|
|
Loading…
Reference in a new issue