Chris Waldon d71f170c29 text: truncate multi-paragraph text correctly
This commit fixes a subtle problem when trunating text widgets that contain
multiple newline-delimited paragraphs.

Paragraphs are the unit of text shaping, so we divide the text into paragraphs
and then iterate those paragraphs performing shaping and line wrapping. If we
have a maximum number of lines to fill, we stop iterating paragraphs when we
use all of the available lines. Usually, if we fill all of the lines the text
shaper will insert the truncator symbol. However, if we exactly fill all of the
lines with the end of a paragraph, the line wrapper is able to fill the line
quota without actually truncating any of the text in that paragraph. Thus it
doesn't insert a truncator even though subsequent paragraphs were truncated (it
has no way to know).

To fix this, I've taught the line wrapper about an explicit scenario in which
we always want to show the truncator symbol *if* we hit the line limit, even if
all of the text in the current paragraph fit. I've then plumbed support for
that through our text stack.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
2023-03-30 12:04:08 -06:00
2022-12-13 17:30:31 -06:00
2022-10-11 13:27:57 -06:00
2022-10-04 17:11:35 -06:00
2023-01-01 10:19:50 -06:00
2020-12-11 16:42:04 +01:00

Gio - https://gioui.org

Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, OpenBSD, Windows, and WebAssembly (experimental).

Installation, examples, documentation

Go to gioui.org.

builds.sr.ht status

Issues

File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/gio@todo.sr.ht. For general discussion, use the mailing list: ~eliasnaur/gio@lists.sr.ht.

Contributing

Post discussion to the mailing list and patches to gio-patches. No Sourcehut account is required and you can post without being subscribed.

See the contribution guide for more details.

An official GitHub mirror is available.

S
Description
No description provided
Readme Multiple Licenses 6.2 MiB
Languages
Go 89.6%
C 7%
Java 1.7%
Objective-C 1.6%