Fix crash for empty text in Text Render

Fixes #327
This commit is contained in:
Wojtek Figat
2021-03-12 15:33:09 +01:00
parent a2be4bb74a
commit 544a043c56

View File

@@ -281,6 +281,11 @@ void TextRender::UpdateLayout()
#endif
// Update text bounds (from build vertex positions)
if (_ib.Data.IsEmpty())
{
// Empty
box = BoundingBox(_transform.Translation, _transform.Translation);
}
_localBox = box;
BoundingBox::Transform(_localBox, _world, _box);
BoundingSphere::FromBox(_box, _sphere);