Fix check

This commit is contained in:
Ali 2023-04-04 18:09:34 +04:00
parent 6658280ed8
commit 6020b4ed14

View File

@ -391,7 +391,7 @@ public class CheckLayer: CALayer {
}
}
if !parameters.theme.filledBorder {
if !parameters.theme.filledBorder && !parameters.theme.hasShadow && !parameters.theme.overlayBorder {
checkProgress = parameters.animationProgress
let fillProgress: CGFloat = parameters.animationProgress
@ -468,8 +468,9 @@ public class CheckLayer: CALayer {
context.strokePath()
case let .counter(number):
let text = NSAttributedString(string: "\(number)", font: Font.with(size: 16.0, design: .round, weight: .regular, traits: []), textColor: parameters.theme.strokeColor)
text.draw(at: CGPoint())
let text = NSAttributedString(string: "\(number)", font: Font.with(size: 16.0, design: .round, weight: .regular, traits: []), textColor: parameters.theme.strokeColor.withMultipliedAlpha(parameters.animationProgress))
let textRect = text.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: [.usesLineFragmentOrigin], context: nil)
text.draw(at: CGPoint(x: UIScreenPixel + textRect.minX + floor((size.width - textRect.width) * 0.5), y: textRect.minY + floor((size.height - textRect.height) * 0.5)))
}
}
}