mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix crash
This commit is contained in:
parent
d7f741d4cf
commit
94b3e47a71
@ -36,8 +36,6 @@ private struct MosaicLayoutAttempt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func chatMessageBubbleMosaicLayout(maxSize: CGSize, itemSizes: [CGSize]) -> ([(CGRect, MosaicItemPosition)], CGSize) {
|
public func chatMessageBubbleMosaicLayout(maxSize: CGSize, itemSizes: [CGSize]) -> ([(CGRect, MosaicItemPosition)], CGSize) {
|
||||||
var larger: Bool = false
|
|
||||||
|
|
||||||
let spacing: CGFloat = 2.0
|
let spacing: CGFloat = 2.0
|
||||||
|
|
||||||
var proportions = ""
|
var proportions = ""
|
||||||
@ -45,7 +43,7 @@ public func chatMessageBubbleMosaicLayout(maxSize: CGSize, itemSizes: [CGSize])
|
|||||||
var forceCalc = false
|
var forceCalc = false
|
||||||
|
|
||||||
var itemInfos = itemSizes.enumerated().map { index, itemSize -> MosaicItemInfo in
|
var itemInfos = itemSizes.enumerated().map { index, itemSize -> MosaicItemInfo in
|
||||||
let aspectRatio = itemSize.width / itemSize.height
|
let aspectRatio = itemSize.height.isZero ? 1.0 : itemSize.width / itemSize.height
|
||||||
if aspectRatio > 1.2 {
|
if aspectRatio > 1.2 {
|
||||||
proportions += "w"
|
proportions += "w"
|
||||||
} else if aspectRatio < 0.8 {
|
} else if aspectRatio < 0.8 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user