summaryrefslogtreecommitdiff
path: root/common/boxutil.c
blob: d012efc39811f856f3321ff1fda0093cded5a532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "boxutil.h"
#include "utils.h"

int box_intersect_line_rough(const BoxRec *b, const xSegment *seg)
{
	/*
	 * First, check whether shadow of the line on the x/y axis are
	 * outside the box shadow.  Note that the box x2/y2 are exclusive.
	 */
	if (b->x1 > maxt(seg->x1, seg->x2) || b->x2 <= mint(seg->x1, seg->x2) ||
	    b->y1 > maxt(seg->y1, seg->y2) || b->y2 <= mint(seg->y1, seg->y2))
		return FALSE;

	return TRUE;
}