Pārlūkot izejas kodu

Merge pull request #17504 from endragor/fix-oversampling-autowrap

Ceil dynamic font glyph size
Juan Linietsky 7 gadi atpakaļ
vecāks
revīzija
7175a7f025
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      scene/resources/dynamic_font.cpp

+ 3 - 0
scene/resources/dynamic_font.cpp

@@ -308,6 +308,9 @@ Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const V
 			ret.x += (delta.x >> 6) / oversampling;
 		}
 	}
+
+	// ensures oversampled glyphs will have enough space when this value is used by clipping/wrapping algorithms
+	ret.x = Math::ceil(ret.x);
 	return ret;
 }