mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-29 23:40:06 +00:00
Limit story dash count
This commit is contained in:
@@ -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) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user