src/text.c

changeset 65
9c44c55d327a
parent 64
f18dc427f86f
child 66
8297afa1c29c
     1.1 --- a/src/text.c	Thu Apr 18 21:53:53 2024 +0200
     1.2 +++ b/src/text.c	Thu Apr 18 22:53:55 2024 +0200
     1.3 @@ -36,7 +36,7 @@
     1.4  
     1.5  static void asc_text_draw(AscText const *node) {
     1.6      // Obtain shader
     1.7 -    AscShaderSprite *shader = &asc_window_active->glctx.shader.sprite;
     1.8 +    AscShaderSprite *shader = &asc_active_window->glctx.shader.sprite;
     1.9  
    1.10      // Upload model matrix
    1.11      glUniformMatrix4fv(shader->base.model, 1,
    1.12 @@ -59,7 +59,8 @@
    1.13      }
    1.14  
    1.15      // Render text onto a surface
    1.16 -    TTF_Font *font = asc_font_cache_validate(node->font)->ptr;
    1.17 +    // TODO: obtain TTF_Font from font cache once it is repaired
    1.18 +    TTF_Font *font = node->font.ptr;
    1.19      static int alignments[] = {
    1.20              TTF_WRAPPED_ALIGN_LEFT,
    1.21              TTF_WRAPPED_ALIGN_CENTER,
    1.22 @@ -101,7 +102,7 @@
    1.23      node->base.position.x = (float) args.x;
    1.24      node->base.position.y = (float) args.y;
    1.25      node->max_width = args.max_width;
    1.26 -    node->font = asc_context.active_font;
    1.27 +    node->font = *asc_active_font;
    1.28      node->color = asc_context.ink;
    1.29      if (args.text == NULL) {
    1.30          node->text = cx_mutstr(strdup(" "));

mercurial