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


Ignore:
Timestamp:
2020-06-05T20:20:06Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8aef01c
Parents:
d70e7b7b
Message:

Window previews need to be drawn as part of ds_display_paint

File:
1 edited

Legend:

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

    rd70e7b7b r6301a24f  
    3737#include <macros.h>
    3838#include <stdbool.h>
     39#include <stddef.h>
    3940
    4041/** Add two vectors.
     
    192193 * If the two rectangles do not intersect, the result will be an empty
    193194 * rectangle (check with gfx_rect_is_empty()). The resulting rectangle
    194  * is always sorted.
     195 * is always sorted. If @a clip is NULL, no clipping is performed.
    195196 *
    196197 * @param rect Source rectangle
    197  * @param clip Clipping rectangle
     198 * @param clip Clipping rectangle or @c NULL
    198199 * @param dest Place to store clipped rectangle
    199200 */
     
    201202{
    202203        gfx_rect_t srect, sclip;
     204
     205        if (clip == NULL) {
     206                *dest = *rect;
     207                return;
     208        }
    203209
    204210        gfx_rect_points_sort(rect, &srect);
     
    235241}
    236242
     243/** Determine if two rectangles share any pixels
     244 *
     245 * @param a First rectangle
     246 * @param b Second rectangle
     247 * @return @c true iff rectangles share any pixels
     248 */
     249bool gfx_rect_is_incident(gfx_rect_t *a, gfx_rect_t *b)
     250{
     251        gfx_rect_t r;
     252
     253        gfx_rect_clip(a, b, &r);
     254        return !gfx_rect_is_empty(&r);
     255}
     256
    237257/** Get rectangle dimensions.
    238258 *
Note: See TracChangeset for help on using the changeset viewer.