Explorar o código

Merge pull request #64745 from bruvzg/fix_mixed_font_color3

[3.x] Fix color modulation of the grayscale glyphs in font with mixed color / grayscale data.
Rémi Verschelde %!s(int64=3) %!d(string=hai) anos
pai
achega
39ac24e278
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      scene/resources/dynamic_font.cpp

+ 1 - 1
scene/resources/dynamic_font.cpp

@@ -523,7 +523,7 @@ float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharT
 			cpos.y -= font->get_ascent();
 			cpos.y -= font->get_ascent();
 			cpos.y += ch->v_align;
 			cpos.y += ch->v_align;
 			Color modulate = p_modulate;
 			Color modulate = p_modulate;
-			if (FT_HAS_COLOR(font->face)) {
+			if (font->textures[ch->texture_idx].texture->get_format() == Image::FORMAT_RGBA8) {
 				modulate.r = modulate.g = modulate.b = 1.0;
 				modulate.r = modulate.g = modulate.b = 1.0;
 			}
 			}
 			RID texture = font->textures[ch->texture_idx].texture->get_rid();
 			RID texture = font->textures[ch->texture_idx].texture->get_rid();