Use 0.5pt borders on @2x displays

This commit is contained in:
Ali 2020-01-22 00:26:44 +04:00
parent 9073516dbd
commit d2fb7f07e5

View File

@ -176,7 +176,12 @@ public func messageBubbleImage(maxCornerRadius: CGFloat, minCornerRadius: CGFloa
context.translateBy(x: additionalInset + strokeInset, y: additionalInset + strokeInset)
context.setStrokeColor(UIColor.black.cgColor)
let borderWidth: CGFloat = UIScreenPixel * 2.0
let borderWidth: CGFloat
if abs(UIScreenPixel - 0.5) < CGFloat.ulpOfOne {
borderWidth = UIScreenPixel
} else {
borderWidth = UIScreenPixel * 2.0
}
context.setLineWidth(borderWidth)
let borderOffset: CGFloat = borderWidth / 2.0