From 33eb7724a0e650bff30c47ca0e944e326773ce46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Sat, 22 Feb 2025 22:49:16 +0200 Subject: [PATCH] Fix label clipping when ascent/descent are fractional. --- scene/gui/label.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index c3fe9283c6e..4c8bca487bd 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -710,10 +710,10 @@ void Label::_notification(int p_what) { Vector2 line_offset = _get_line_rect(p, i).position; ofs.x = line_offset.x; - int asc = TS->shaped_text_get_ascent(line_rid); - int dsc = TS->shaped_text_get_descent(line_rid); + double asc = TS->shaped_text_get_ascent(line_rid); + double dsc = TS->shaped_text_get_descent(line_rid); if (asc + dsc < font_h) { - int diff = font_h - (asc + dsc); + double diff = font_h - (asc + dsc); asc += diff / 2; dsc += diff - (diff / 2); }