This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 266
Blurry UILabel #196
Labels
Comments
A reference to a similar issue on StackOverflow: |
I think this qualifies as a bug, thanks for reporting, @moshegutman . |
Following your advice, I went with this: public init(vertical: Vertical, horizontal: Horizontal) {
self.aligner = { (size: CGSize, rect: CGRect) -> CGRect in
let (x, width) = horizontal.align(length: size.width, availableLength: rect.width, offset: rect.origin.x)
let (y, height) = vertical.align(length: size.height, availableLength: rect.height, offset: rect.origin.y)
return CGRect(x: x.roundedToFractionalPoint, y: y.roundedToFractionalPoint, width: width.roundedToFractionalPoint, height: height.roundedToFractionalPoint)
}
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using a UILabel and the alignment frame isn't placed on an integer value, the text can appear blurry.
I solved this by adjusting the return
CGRect
inside theAlignment
constructor. I added a call to.integral
Not sure if this should be classified as a bug
The text was updated successfully, but these errors were encountered: