https://kotlinlang.org logo
#compose
Title
# compose
o

orangy

08/08/2022, 2:20 PM
Is it possible to get exact offset from
TextLayoutResult
, kinda like
getOffsetForPosition
but returning null, if there is no text at coordinates? E.g. if text is wrapped and second line is shorter, I would like to know if coordinates are over real text, or over blank part here ->
h

Halil Ozercan

08/08/2022, 4:14 PM
You can run a
getBoundingBox(offset)
at the returned offset from
getOffsetForPosition
and check whether this boundingbox contains the original position.
s

Siyamed

08/08/2022, 10:37 PM
Sounds like a good feature request, can you please file one?
getLine(Start/End/Right/Left) might help
o

orangy

08/10/2022, 4:20 PM
15 Views