mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-05 18:46:53 +02:00
fix text debug assert on invalid or unloaded font
This commit is contained in:
parent
729b85062d
commit
0dd0d07466
1 changed files with 5 additions and 1 deletions
|
@ -367,7 +367,11 @@ void entities::TextPayload::render(RenderArgs* args) {
|
|||
transform.setRotation(BillboardModeHelpers::getBillboardRotation(transform.getTranslation(), transform.getRotation(), textRenderable->_billboardMode,
|
||||
usePrimaryFrustum ? BillboardModeHelpers::getPrimaryViewFrustumPosition() : args->getViewFrustum().getPosition()));
|
||||
|
||||
float scale = textRenderable->_lineHeight / textRenderer->getFontHeight();
|
||||
float scale = 1.0f;
|
||||
float fontHeight = textRenderer->getFontHeight();
|
||||
if (fontHeight > 0.0f) {
|
||||
scale = textRenderable->_lineHeight / fontHeight;
|
||||
}
|
||||
transform.postTranslate(glm::vec3(-0.5, 0.5, 1.0f + EPSILON / dimensions.z));
|
||||
transform.setScale(scale);
|
||||
batch.setModelTransform(transform);
|
||||
|
|
Loading…
Reference in a new issue