3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
13 * A simple class representing rectangular regions.
14 * It is expected that the box be constructed in
15 * normalised form, that is to say : x1,y1 is top-left,
16 * x2,y2 is bottom-right.
18 * Negative values are allowed.
28 x1(x1_), x2(x2_), y1(y1_), y2(y2_) {}
31 * Returns true if the given co-ordinates are within
32 * the box. Check is exclusive (point on a border
35 bool contained(int x, int y) {
36 return (x1 < x && x2 > x &&
43 inline std::ostream & operator<<(std::ostream & o, Box & b)
45 return o << "x1,y1: " << b.x1 << "," << b.y1
46 << " x2,y2: " << b.x2 << "," << b.y2 << std::endl;