Explorar o código

Update scene/resources/dynamic_font.cpp

Co-authored-by: Hugo Locurcio <[email protected]>
Juan Linietsky %!s(int64=4) %!d(string=hai) anos
pai
achega
a65481dd35
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      scene/resources/dynamic_font.cpp

+ 2 - 0
scene/resources/dynamic_font.cpp

@@ -459,6 +459,8 @@ DynamicFontAtSize::TexturePosition DynamicFontAtSize::_find_texture_pos_for_glyp
 			uint8_t *w = tex.imgdata.ptrw();
 			uint8_t *w = tex.imgdata.ptrw();
 			ERR_FAIL_COND_V(texsize * texsize * p_color_size > tex.imgdata.size(), ret);
 			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) {
 			if (p_color_size == 2) {
 				for (int i = 0; i < texsize * texsize * p_color_size; i += 2) {
 				for (int i = 0; i < texsize * texsize * p_color_size; i += 2) {
 					w[i + 0] = 255;
 					w[i + 0] = 255;