mirror of
https://github.com/danbulant/cushy
synced 2026-06-16 13:01:11 +00:00
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:
parent
884febecfa
commit
aa47539518
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue