summaryrefslogtreecommitdiff
path: root/rect.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-06-02 21:46:07 +1000
committerquou <quou@disroot.org>2024-06-02 21:47:26 +1000
commit62b4a3ededd237f4b4850d91c052585e2f687499 (patch)
tree25bf590a634c6c71f399cf9b1d620500f06b8b9f /rect.c
parent2e761bdb8badecdbda2925a056a6d5aa3e3cac83 (diff)
Switched to luigi, parsing out FLAC metadata.
Diffstat (limited to 'rect.c')
-rw-r--r--rect.c96
1 files changed, 0 insertions, 96 deletions
diff --git a/rect.c b/rect.c
deleted file mode 100644
index bcc95cd..0000000
--- a/rect.c
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "maths.h"
-#include "rect.h"
-
-Rectangle make_rect(int x, int y, int w, int h) {
- Rectangle r;
- r.x = x;
- r.y = y;
- r.w = w;
- r.h = h;
- return r;
-}
-
-int rects_overlap(const Rectangle* a, const Rectangle* b) {
- return
- a->x + a->w > b->x &&
- a->y + a->h > b->y &&
- a->x < b->x + b->w &&
- a->y < b->y + b->h;
-}
-
-int rects_overlap2(
- int x0,
- int y0,
- int w0,
- int h0,
- int x1,
- int y1,
- int w1,
- int h1
-) {
- return
- x0 + w0 > x1 &&
- y0 + h0 > y1 &&
- x0 < x1 + w1 &&
- y0 < y1 + h1;
-}
-
-int point_rect_overlap(
- const Rectangle* r,
- int px,
- int py
-) {
- return
- px >= r->x &&
- py >= r->y &&
- px <= r->x + r->w &&
- py <= r->y + r->h;
-}
-
-int point_rect_overlap2(
- int x,
- int y,
- int w,
- int h,
- int px,
- int py
-) {
- return
- px > x &&
- py > y &&
- px < x + w &&
- py < y + h;
-}
-
-Rectangle rect_intersect(
- const Rectangle* a,
- const Rectangle* b
-) {
- int x1, y1, x2, y2;
- Rectangle r;
- x1 = maxi(a->x, b->x);
- y1 = maxi(a->y, b->y);
- x2 = mini(a->x + a->w, b->x + b->w);
- y2 = mini(a->y + a->h, b->y + b->h);
- r.x = x1;
- r.y = y1;
- r.w = maxi(0, x2 - x1);
- r.h = maxi(0, y2 - y1);
- return r;
-}
-
-Rectangle* rect_merge(
- Rectangle* d,
- const Rectangle* r
-) {
- int x1, y1, x2, y2;
- x1 = mini(d->x, r->x);
- y1 = mini(d->y, r->y);
- x2 = maxi(d->x + d->w, r->x + r->w);
- y2 = maxi(d->y + d->h, r->y + r->h);
- d->x = x1;
- d->y = y1;
- d->w = x2 - x1;
- d->h = y2 - y1;
- return d;
-}