Преглед изворни кода

fix incorrect width calculation with missing characters in font

David Rose пре 23 година
родитељ
комит
c37acce234
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      panda/src/text/textNode.cxx

+ 2 - 1
panda/src/text/textNode.cxx

@@ -1026,7 +1026,8 @@ measure_row(wstring::iterator &si, const wstring::iterator &send,
 
 
       const TextGlyph *glyph;
       const TextGlyph *glyph;
       float glyph_scale;
       float glyph_scale;
-      if (font->get_glyph(character, glyph, glyph_scale)) {
+      font->get_glyph(character, glyph, glyph_scale);
+      if (glyph != (TextGlyph *)NULL) {
         xpos += glyph->get_advance() * glyph_scale;
         xpos += glyph->get_advance() * glyph_scale;
       }
       }
     }
     }