TICKIT_RECT_INTERSECT(3)

πŸ’– TICKIT_RECT_INTERSECT πŸ’–

okay bestie, gather round, because this one is from the Library Functions Manual, section 3, and it is so useful it's giving main character energy fr fr ✨


✨ NAME ✨

tickit_rect_intersect β€” obtain the intersection of two rectangles


🌸 SYNOPSIS 🌸

#include <tickit.h>

bool tickit_rect_intersect(TickitRect *dst,
     const TickitRect *a, const TickitRect *b);

Link with -ltickit.


πŸ¦‹ DESCRIPTION πŸ¦‹

so tickit_rect_intersect() looks at the two rectangles you handed it, a and b, and checks if they intersect. if they do?? it initialises the rectangle structure pointed at by dst to hold that intersection, and returns true πŸ’…. that's it, that's the whole vibe.

if the two rectangles do not intersect, it returns false and does not touch the structure given by dst. like, hands off, no notes, it stays exactly how you left it πŸ™ˆ.

now here's the lowkey iconic part: dst may be equal to either a or b, or it can be a completely distinct rectangle structure. doesn't matter. the two source rectangles are read before the result gets written, so you're safe either way 🫢.

btw, if all you wanna do is test whether two rectangles intersect and you do not care about actually getting the intersection region back β€” use tickit_rect_intersects(3) instead. different function, different job, no cap ✨

πŸŽ€ RETURN VALUE πŸŽ€

tickit_rect_intersect() returns true if the rectangles intersect, and false if they don't. periodt. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie πŸ’– this was TICKIT_RECT_INTERSECT(3) from the Library Functions Manual, section 3 β€” no version string, no date, just pure rectangle-intersection excellence. slay, go intersect something 🌈✨🧚