Changeset 0e6e77f in mainline for uspace/lib/gfx/src/coord.c


Ignore:
Timestamp:
2020-02-28T15:44:55Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a8eed5f
Parents:
2a515dcd
git-author:
Jiri Svoboda <jiri@…> (2020-02-26 18:26:13)
git-committer:
Jiri Svoboda <jiri@…> (2020-02-28 15:44:55)
Message:

Window resize by client request

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfx/src/coord.c

    r2a515dcd r0e6e77f  
    235235}
    236236
     237/** Get rectangle dimensions.
     238 *
     239 * Get a vector containing the x, y dimensions of a rectangle. These are
     240 * always nonnegative.
     241 *
     242 * @param rect Rectangle
     243 * @param dims Place to store dimensions
     244 */
     245void gfx_rect_dims(gfx_rect_t *rect, gfx_coord2_t *dims)
     246{
     247        gfx_rect_t srect;
     248
     249        gfx_rect_points_sort(rect, &srect);
     250        gfx_coord2_subtract(&srect.p1, &srect.p0, dims);
     251}
     252
    237253/** Return true if pixel at coordinate @a coord lies within rectangle @a rect. */
    238254bool gfx_pix_inside_rect(gfx_coord2_t *coord, gfx_rect_t *rect)
Note: See TracChangeset for help on using the changeset viewer.