summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-11-01 11:51:29 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-11-01 11:51:29 +0200
commit02a4b3f85959cb96ac1823a37f9d568b819cc6c5 (patch)
treee1be5d05ae0b3f272d9761fa8c7adb8453d9f354
parente6751549cf7247965d1744b8c464f5e901006f21 (diff)
[TextServer] Fix hex code box positions in vertical text layout.
-rw-r--r--modules/text_server_adv/text_server_adv.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index f310f46af9..155da3c67b 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -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));
}