lilypond-0.1.57
[lilypond.git] / lily / boxes.cc
blob1529c7074915798270cde15212c9054caceeafd7
1 /*
2 boxes.cc -- implement Box
4 source file of the GNU LilyPond music typesetter
6 (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "boxes.hh"
10 #include "varray.hh"
12 void
13 Box::translate (Offset o)
15 for (Axis i=X_AXIS; i < NO_AXES; incr(i))
16 interval_a_[i] += o[i];
19 void
20 Box::unite (Box b)
22 for (Axis i=X_AXIS; i < NO_AXES; incr(i))
23 interval_a_[i].unite (b[i]);
26 /**
27 Initialize to empty.
29 Box::Box()
33 Box::Box (Interval ix, Interval iy)
35 x() = ix;
36 y() = iy;
39 Interval &
40 Box::operator[] (Axis a)
42 return interval_a_[a];
45 Interval
46 Box::operator[] (Axis a)const
48 return interval_a_[a];