mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ByteOffset returns the offset of the start byte of the rune nearest
|
// ByteOffset returns the start byte of the rune at the given
|
||||||
// to the rune at the given offset. If the given offset is before or
|
// rune offset, clamped to the size of the text.
|
||||||
// after the text, it will be clamped to the first or last rune.
|
|
||||||
func (e *textView) ByteOffset(runeOffset int) int64 {
|
func (e *textView) ByteOffset(runeOffset int) int64 {
|
||||||
return int64(e.runeOffset(e.closestToRune(runeOffset).runes))
|
return int64(e.runeOffset(e.closestToRune(runeOffset).runes))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user