mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget: update ByteOffset method docs
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
+2
-3
@@ -326,9 +326,8 @@ func (e *textView) CaretInfo() (pos image.Point, ascent, descent int) {
|
||||
return
|
||||
}
|
||||
|
||||
// ByteOffset returns the offset of the start byte of the rune nearest
|
||||
// to the rune at the given offset. If the given offset is before or
|
||||
// after the text, it will be clamped to the first or last rune.
|
||||
// ByteOffset returns the start byte of the rune at the given
|
||||
// rune offset, clamped to the size of the text.
|
||||
func (e *textView) ByteOffset(runeOffset int) int64 {
|
||||
return int64(e.runeOffset(e.closestToRune(runeOffset).runes))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user