Attempting to tweak glyph calculation

This commit is contained in:
Jonathan Johnson 2024-07-26 09:51:29 -07:00
parent 4c9dd5d7ca
commit b33e06ac4e
No known key found for this signature in database
GPG key ID: A66D6A34D6620579

View file

@ -881,9 +881,6 @@ where
}; };
} }
// Make relative be relative to the center of the glyph for a nearest search.
let relative = relative + rect.size / 2;
let line_height = cache.measured.line_height.get(); let line_height = cache.measured.line_height.get();
if relative.y < 0 || relative.y >= line_height { if relative.y < 0 || relative.y >= line_height {
continue; continue;
@ -897,7 +894,7 @@ where
) )
.saturating_abs(); .saturating_abs();
let cursor = Cursor { let cursor = Cursor {
offset: if relative.x <= rect.size.width / 3 { offset: if dbg!(relative.x) <= rect.size.width / 3 {
glyph.info.start glyph.info.start
} else { } else {
glyph.info.end glyph.info.end