Skip to content

Let a caption hold more than one line, and say 完成 in words - #15

Merged
ursasi merged 1 commit into
mainfrom
fix/caption-multiline-and-letter-keys
Oct 26, 2026
Merged

ursasi merged 1 commit into
mainfrom
fix/caption-multiline-and-letter-keys

Conversation

@ursasi

@ursasi ursasi commented Oct 26, 2026

Copy link
Copy Markdown
Owner

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, and AnnotationRenderer drew every caption into a box of fontSize * 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

R O A P H T M B — 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

check result
three-line caption while typing all three lines visible, box grew to fit
the same caption after commit all three lines in the saved PNG
O on the keyboard ellipse lights up in the bar
bar − 粗细 4 + … 完成
hint 拖拽即可标注 ⌘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.

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.
@ursasi
ursasi merged commit d67731e into main Oct 26, 2026
1 check passed
@ursasi
ursasi deleted the fix/caption-multiline-and-letter-keys branch October 30, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant