Changeset 4583015 in mainline for uspace/lib/ui/src/paint.c


Ignore:
Timestamp:
2022-03-07T16:10:44Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca2680d
Parents:
5c27e77
Message:

Add font to gfx_text_fmt_t

This is quite logical and saves us one argument that we need to pass to
all text formatting functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/paint.c

    r5c27e77 r4583015  
    402402
    403403        gfx_text_fmt_init(&fmt);
     404        fmt.font = resource->font;
    404405        fmt.color = color;
    405406
     
    427428
    428429        pos = rect->p0;
    429         rc = gfx_puttext(resource->font, &pos, &fmt, str);
     430        rc = gfx_puttext(&pos, &fmt, str);
    430431        if (rc != EOK)
    431432                goto error;
     
    436437
    437438                pos.x = rect->p0.x;
    438                 rc = gfx_puttext(resource->font, &pos, &fmt,
    439                     boxc->c[1][0]);
     439                rc = gfx_puttext(&pos, &fmt, boxc->c[1][0]);
    440440                if (rc != EOK)
    441441                        goto error;
    442442
    443443                pos.x = rect->p1.x - 1;
    444                 rc = gfx_puttext(resource->font, &pos, &fmt,
    445                     boxc->c[1][2]);
     444                rc = gfx_puttext(&pos, &fmt, boxc->c[1][2]);
    446445                if (rc != EOK)
    447446                        goto error;
     
    464463        pos.x = rect->p0.x;
    465464        pos.y = rect->p1.y - 1;
    466         rc = gfx_puttext(resource->font, &pos, &fmt, str);
     465        rc = gfx_puttext(&pos, &fmt, str);
    467466        if (rc != EOK)
    468467                goto error;
     
    519518
    520519        gfx_text_fmt_init(&fmt);
     520        fmt.font = resource->font;
    521521        fmt.color = color;
    522522
     
    542542
    543543        pos = rect->p0;
    544         rc = gfx_puttext(resource->font, &pos, &fmt, str);
     544        rc = gfx_puttext(&pos, &fmt, str);
    545545        if (rc != EOK)
    546546                goto error;
Note: See TracChangeset for help on using the changeset viewer.