diff --git a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift index 49a445e671..1cea706b2c 100644 --- a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift @@ -58,6 +58,15 @@ private func calculateCircleIntersection(center: CGPoint, otherCenter: CGPoint, } private func calculateMergingCircleShape(center: CGPoint, leftCenter: CGPoint?, rightCenter: CGPoint?, radius: CGFloat, totalCount: Int, unseenCount: Int, isSeen: Bool, segmentFraction: CGFloat, rotationFraction: CGFloat) -> CGPath { + var totalCount = totalCount + var unseenCount = unseenCount + + let totalCountNorm = CGFloat(totalCount) / 30.0 + if totalCountNorm > 1.0 { + totalCount = Int(CGFloat(totalCount) / totalCountNorm) + unseenCount = Int(CGFloat(unseenCount) / totalCountNorm) + } + let leftAngles = leftCenter.flatMap { calculateCircleIntersection(center: center, otherCenter: $0, radius: radius) } let rightAngles = rightCenter.flatMap { calculateCircleIntersection(center: center, otherCenter: $0, radius: radius) }