Repository navigation
Let a caption hold more than one line, and say 完成 in words - #15
Merged
Merged
Conversation
Typing a line break in a caption pushed its first line out of the box: the caption was an NSTextField, which is one line tall, and the renderer drew every caption into a box of `fontSize * 1.6` no matter what was in it. The caption is a text view now, growing with what is typed; ⏎ still finishes the snip and ⇧⏎ / ⌥⏎ starts a new line. The renderer and the grab area both measure the text instead of assuming a single line, so a three-line caption comes out whole. The tools also answer to letters — R O A P H T M B — with the old digits kept as aliases, and their tooltips say the letter instead of a position in the row. The commit button spells 完成 next to the tick, because a bare tick left people hunting for a ⏎ they had never been told about. A `multitext:` debug command drops a caption into the current snip so the rendered result can be checked without typing.
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.
Three things about writing a caption.
1. A line break clipped the top of the text
The caption was an
NSTextField, which is one line tall, andAnnotationRendererdrew every caption into a box offontSize * 1.6. A second line therefore pushed the first out of the box while typing, and the drawn result was clipped the same way.The caption is a text view now and grows with what is typed. The renderer and the grab area both measure the text (
boundingRect(with:options:)) instead of assuming a line, so a three-line caption comes out whole.⏎ still finishes the snip — that was asked for earlier — and ⇧⏎ / ⌥⏎ starts a new line. The hint under the bar says so.
2. The commit button says 完成
A bare tick left people hunting for a ⏎ they had never been told about. The button is wider now and spells
完成next to the tick; its tooltip reads完成 ⏎ 或点这里.3. Tools answer to letters
ROAPHTMB— rect, ellipse, arrow, pen, highlighter, text, mosaic, blur — instead of digits, which nobody could map to an icon. Digits keep working as aliases, and the tooltips show the letter (马赛克 M).The hint line reads
R/O/A/P/H/T/M/B 选工具, and both READMEs are updated.Verification
Oon the keyboard− 粗细 4 +…完成拖拽即可标注 ⌘Z 撤销 Esc 回到选区 ⇧⏎ 换行Note: driving the overlay through synthesised mouse and key events is flaky while someone is using the machine, so the rendered-result checks go through a new
multitext:debug command that drops a caption straight into the current snip.