Utility/Font: Fix handling of whitespace glyphs
This commit is contained in:
parent
bf0b8e9c76
commit
347f8cc986
|
|
@ -86,6 +86,8 @@ Nazara Engine:
|
||||||
- Fixed Billboard bounding volume
|
- Fixed Billboard bounding volume
|
||||||
- Fixed Directory::GetResultSize and Directory::IsResultDirectory on Posix systems
|
- Fixed Directory::GetResultSize and Directory::IsResultDirectory on Posix systems
|
||||||
- Graphics module now register "White2D" and "WhiteCubemap" textures to the TextureLibrary (respectively a 1x1 texture 2D and a 1x1 texture cubemap)
|
- Graphics module now register "White2D" and "WhiteCubemap" textures to the TextureLibrary (respectively a 1x1 texture 2D and a 1x1 texture cubemap)
|
||||||
|
- Added AbstractTextDrawer::GetLineGlyphCount, which returns the number of glyph part of the line
|
||||||
|
- Fixed Font handling of whitespace glyphs (which were triggering an error)
|
||||||
|
|
||||||
Nazara Development Kit:
|
Nazara Development Kit:
|
||||||
- Added ImageWidget (#139)
|
- Added ImageWidget (#139)
|
||||||
|
|
|
||||||
|
|
@ -513,9 +513,17 @@ namespace Nz
|
||||||
// On extrait le glyphe depuis la police
|
// On extrait le glyphe depuis la police
|
||||||
FontGlyph fontGlyph;
|
FontGlyph fontGlyph;
|
||||||
if (ExtractGlyph(characterSize, character, style, &fontGlyph))
|
if (ExtractGlyph(characterSize, character, style, &fontGlyph))
|
||||||
|
{
|
||||||
|
if (fontGlyph.image.IsValid())
|
||||||
{
|
{
|
||||||
glyph.atlasRect.width = fontGlyph.image.GetWidth();
|
glyph.atlasRect.width = fontGlyph.image.GetWidth();
|
||||||
glyph.atlasRect.height = fontGlyph.image.GetHeight();
|
glyph.atlasRect.height = fontGlyph.image.GetHeight();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glyph.atlasRect.width = 0;
|
||||||
|
glyph.atlasRect.height = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Insertion du rectangle dans l'un des atlas
|
// Insertion du rectangle dans l'un des atlas
|
||||||
if (glyph.atlasRect.width > 0 && glyph.atlasRect.height > 0) // Si l'image contient quelque chose
|
if (glyph.atlasRect.width > 0 && glyph.atlasRect.height > 0) // Si l'image contient quelque chose
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue