Merge pull request #68110 from bruvzg/hexbox_ver

[TextServer] Fix hex code box positions in vertical text layout.
This commit is contained in:
Rémi Verschelde 2022-11-02 14:15:23 +01:00
commit 1bd7f2110a
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -5072,6 +5072,8 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star
p_sd->ascent = MAX(p_sd->ascent, get_hex_code_box_size(fs, gl.index).y);
} else {
gl.advance = get_hex_code_box_size(fs, gl.index).y;
gl.y_off = get_hex_code_box_size(fs, gl.index).y;
gl.x_off = -Math::round(get_hex_code_box_size(fs, gl.index).x * 0.5);
p_sd->ascent = MAX(p_sd->ascent, Math::round(get_hex_code_box_size(fs, gl.index).x * 0.5));
p_sd->descent = MAX(p_sd->descent, Math::round(get_hex_code_box_size(fs, gl.index).x * 0.5));
}