Show text being typed as the pixels it will be committed as - #121
Merged
Merged
Conversation
The inline editor drew macOS vector text at screen resolution, so zoomed in it looked sharper than the layer it made, and confirming the text made it go soft. As in Photoshop, the canvas now draws the text being typed as the layer's own pixels, in its place among the layers and with the layer's opacity and blend mode; the text view keeps the caret, selection and input with clear glyphs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Zoomed past 100%, text looked sharp while typing and went soft once confirmed. The inline editor drew macOS vector text at screen resolution, while the committed layer holds the text at document resolution.
This matches Photoshop: text being typed is shown as the pixels it will be committed as, so confirming changes nothing on screen.
EditorSession.textImage, the same render the layer gets, at the transform the editor shows. Existing text draws in its place in the stack with the layer's opacity and blend mode. New text draws just above the active layer, where its layer will go, or on top if that layer isn't drawn. The render is cached by style, so it's remade only when the text or its style changes.NSTextViewkeeps the caret, selection, IME and clipboard, but its glyphs are clear. The caret keeps the text color, and the selection is a translucent highlight so the text shows through.Test:
TypeToolTests.textLooksTheSameWhileEditingAndOnceCommitteddraws a real canvas at 150% and 400%, checks the typed text is drawn, and compares it with the canvas after committing. It fails onmain.🤖 Generated with Claude Code