mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
d71f170c29810a889d10ddb05246b05616a4cea0
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>
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.
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.
Description
Languages
Go
89.6%
C
7%
Java
1.7%
Objective-C
1.6%