mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
widget: expose text region resolution
This commit adds exported methods to both LabelState and Editor allowing callers to locate the text regions representing a range of runes. This can be used to build interactive subregions of text, like (for instance) hyperlinks. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -307,6 +307,10 @@ type Region struct {
|
||||
Baseline int
|
||||
}
|
||||
|
||||
// region is identical to Region except that its coordinates are in document
|
||||
// space instead of a widget coordinate space.
|
||||
type region = Region
|
||||
|
||||
// locate returns highlight regions covering the glyphs that represent the runes in
|
||||
// [startRune,endRune). If the rects parameter is non-nil, locate will use it to
|
||||
// return results instead of allocating, provided that there is enough capacity.
|
||||
|
||||
Reference in New Issue
Block a user