Thu, 17 Jul 2025 19:45:44 +0200
fix accidental overwrite of the update flag when creating text
src/text.c | file | annotate | diff | comparison | revisions |
--- a/src/text.c Thu Jul 17 19:44:22 2025 +0200 +++ b/src/text.c Thu Jul 17 19:45:44 2025 +0200 @@ -150,14 +150,6 @@ AscText *text = cxZallocDefault(sizeof(AscText)); asc_ptr_cast(AscSceneNode, node, text); - // node properties - asc_scene_node_init(node, - ASC_SCENE_NODE_FUNCS(asc_text), - .name = args.name, - .render_group = ASC_RENDER_GROUP_2D_BLEND, - .pos2d = ASC_VEC2I(args.x, args.y) - ); - // text properties node->flags = args.alignment; // use flags variable to save some space text->max_width = args.max_width; @@ -176,8 +168,14 @@ // mesh will be created in the update func 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); + + // basic node properties + asc_scene_node_init(node, + ASC_SCENE_NODE_FUNCS(asc_text), + .name = args.name, + .render_group = ASC_RENDER_GROUP_2D_BLEND, + .pos2d = ASC_VEC2I(args.x, args.y) + ); return node; }