Repository navigation
Keep an edited caption sharp when its size changes - #17
Merged
Merged
Conversation
Changing the type size set the control's font but left the text run with its old font attribute, so AppKit scaled the existing glyphs up — which reads as blur. The new font is applied to the whole storage (and to the typing attributes, so what comes next matches). The editor's frame is also kept on whole points now: a fractional origin or height puts the glyphs between pixels and softens every edge, which gets worse the more times the size changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changing the type size while typing a caption made the text look blurred.
Two causes, both in the editor:
.fontattribute, so AppKit scaled the existing glyphs up to the new size instead of shaping them — blurry, and worse the further the size moved.layout.usedRect), which puts glyphs between pixels and softens every edge.The new font is now applied to the whole text storage, plus the typing attributes so following keystrokes match; the frame's origin is rounded and its height is
ceiled on every change.