]> git.lyx.org Git - lyx.git/blob - src/box.C
work around for bug reported by Mario Morandini
[lyx.git] / src / box.C
1 /**
2  * \file box.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 // Code moved out of line and out of box.h by Angus (7 Jan 2002)
10
11 #include "box.h"
12
13 #include "support/LOstream.h"
14
15 using std::ostream;
16
17 Box::Box(int x1_, int x2_, int y1_, int y2_) :
18         x1(x1_), x2(x2_), y1(y1_), y2(y2_)
19 {}
20
21 bool Box::contained(int x, int y)
22 {
23         return (x1 < x && x2 > x &&
24                 y1 < y && y2 > y);
25 }
26
27
28 ostream & operator<<(ostream & o, Box const & b)
29 {
30         return o << "x1,y1: " << b.x1 << "," << b.y1
31                 << " x2,y2: " << b.x2 << "," << b.y2 << std::endl;
32 }