Update scene/resources/dynamic_font.cpp

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
Juan Linietsky 2020-10-28 22:09:37 -03:00 committed by GitHub
parent 8ab9b39707
commit a65481dd35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -459,6 +459,8 @@ DynamicFontAtSize::TexturePosition DynamicFontAtSize::_find_texture_pos_for_glyp
uint8_t *w = tex.imgdata.ptrw();
ERR_FAIL_COND_V(texsize * texsize * p_color_size > tex.imgdata.size(), ret);
// Initialize the texture to all-white pixels to prevent artifacts when the
// font is displayed at a non-default scale with filtering enabled.
if (p_color_size == 2) {
for (int i = 0; i < texsize * texsize * p_color_size; i += 2) {
w[i + 0] = 255;