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


Ignore:
Timestamp:
2020-06-14T22:23:34Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c45d8696
Parents:
28f8f6f2
Message:

Allow GUI direct access to window buffer

File:
1 edited

Legend:

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

    r28f8f6f2 rafcf704  
    255255}
    256256
     257/** Return true if rectangle @a a is contained in rectangle @a b.
     258 *
     259 * @param a Inside rectangle
     260 * @param b Outside rectangle
     261 * @return @c true iff @a a is (non-strictly) inside @a b
     262 */
     263bool gfx_rect_is_inside(gfx_rect_t *a, gfx_rect_t *b)
     264{
     265        gfx_rect_t sa;
     266        gfx_rect_t sb;
     267
     268        gfx_rect_points_sort(a, &sa);
     269        gfx_rect_points_sort(b, &sb);
     270
     271        if (sa.p0.x < sb.p0.x || sa.p0.y < sb.p0.y)
     272                return false;
     273
     274        if (sa.p1.x > sb.p1.x || sa.p1.y > sb.p1.y)
     275                return false;
     276
     277        return true;
     278}
     279
    257280/** Get rectangle dimensions.
    258281 *
Note: See TracChangeset for help on using the changeset viewer.