Limit story dash count

This commit is contained in:
Ali
2023-09-17 14:32:46 +02:00
parent bee2c127d3
commit b8fa839abe

View File

@@ -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) }