Using glyph end instead of incrementing start

Closes #112

This removes the last manual byte change I can find. While what the user
reported was that this was causing incorrect selection, using the arrow
keys when in this situation could lead to a panic, because the offset
was not a valid character offset.
This commit is contained in:
Jonathan Johnson 2023-12-27 08:32:26 -08:00
parent 884febecfa
commit aa47539518
No known key found for this signature in database
GPG key ID: A66D6A34D6620579

View file

@ -872,9 +872,9 @@ where
&& relative.y <= cache.measured.line_height
{
return if relative.x > rect.size.width / 2 {
if glyph.info.start + 1 < cache.bytes {
if glyph.info.end < cache.bytes {
Cursor {
offset: glyph.info.start + 1,
offset: glyph.info.end,
affinity: Affinity::Before,
}
} else {