Changeset 6301a24f in mainline for uspace/lib/gfx/src/coord.c
- Timestamp:
- 2020-06-05T20:20:06Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8aef01c
- Parents:
- d70e7b7b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfx/src/coord.c
rd70e7b7b r6301a24f 37 37 #include <macros.h> 38 38 #include <stdbool.h> 39 #include <stddef.h> 39 40 40 41 /** Add two vectors. … … 192 193 * If the two rectangles do not intersect, the result will be an empty 193 194 * 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. 195 196 * 196 197 * @param rect Source rectangle 197 * @param clip Clipping rectangle 198 * @param clip Clipping rectangle or @c NULL 198 199 * @param dest Place to store clipped rectangle 199 200 */ … … 201 202 { 202 203 gfx_rect_t srect, sclip; 204 205 if (clip == NULL) { 206 *dest = *rect; 207 return; 208 } 203 209 204 210 gfx_rect_points_sort(rect, &srect); … … 235 241 } 236 242 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 */ 249 bool 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 237 257 /** Get rectangle dimensions. 238 258 *
Note:
See TracChangeset
for help on using the changeset viewer.