mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-04-27 02:14:45 +00:00
fix divide by zero (#1911)
This commit is contained in:
parent
17387626b8
commit
92662665b9
1 changed files with 2 additions and 0 deletions
|
@ -197,6 +197,8 @@ struct DefaultPreviewImage: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func calculateSize(_ proposal: ProposedViewSize) -> CGSize {
|
private func calculateSize(_ proposal: ProposedViewSize) -> CGSize {
|
||||||
|
guard originalWidth > 0 else { return CGSize.zero }
|
||||||
|
|
||||||
return switch (proposal.width, proposal.height) {
|
return switch (proposal.width, proposal.height) {
|
||||||
case (nil, nil):
|
case (nil, nil):
|
||||||
CGSize(width: originalWidth, height: originalWidth)
|
CGSize(width: originalWidth, height: originalWidth)
|
||||||
|
|
Loading…
Reference in a new issue