Adjust hex code box baseline calculation.

This commit is contained in:
Pāvels Nadtočajevs 2025-05-20 08:53:40 +03:00
parent be3ecaeb3c
commit 7fc4521dd8
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
3 changed files with 13 additions and 7 deletions

View file

@ -1708,7 +1708,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V
} else if (!(glyphs[glyph_idx].flags & TextServer::GRAPHEME_IS_VIRTUAL)) {
// Hex code box.
Vector2 gl_size = TS->get_hex_code_box_size(glyphs[glyph_idx].font_size, glyphs[glyph_idx].index);
if (p_click.y >= baseline_y - gl_size.y * 0.9 && p_click.y <= baseline_y + gl_size.y * 0.2) {
if (p_click.y >= baseline_y - gl_size.y * 0.85 && p_click.y <= baseline_y + gl_size.y * 0.15) {
char_pos = glyphs[glyph_idx].start;
char_clicked = true;
}