diff -r 4d184a8706b1 -r 658bccb1bf73 src/text.c --- a/src/text.c Wed Jul 16 23:27:34 2025 +0200 +++ b/src/text.c Thu Jul 17 19:44:22 2025 +0200 @@ -97,9 +97,9 @@ asc_texture_from_surface(text->texture, surface); // If dimensions changed, update the mesh - if (text->dimension.x != (unsigned)surface->w || text->dimension.y != (unsigned)surface->h) { - text->dimension.x = surface->w; - text->dimension.y = surface->h; + if (text->dimension.width != (unsigned)surface->w || text->dimension.height != (unsigned)surface->h) { + text->dimension.width = surface->w; + text->dimension.height = surface->h; const asc_vec2f uv_scale = asc_texture_calculate_uv_scale(text->texture, text->dimension, ASC_VEC2F_1); asc_mesh_plane_2d(&text->mesh, .size = ASC_VEC2F(surface->w, surface->h), @@ -117,6 +117,9 @@ static void asc_text_draw(const AscCamera *camera, const AscSceneNode *node) { asc_cptr_cast(AscText, text, node); + // early exit when the text has no width + if (text->dimension.width == 0) return; + // Activate shader // TODO: scene should know which shader we are going to activate s.t. it can pre-sort nodes const AscShaderProgram *shader = asc_shader_lookup_or_create( @@ -174,7 +177,7 @@ text->texture = cxMallocDefault(sizeof(AscTexture)); asc_texture_init_rectangle(text->texture, 1); // TODO: check why we can't just wait for the first normal update to happen - asc_text_update(node); + //asc_text_update(node); return node; }