]> git.donarmstrong.com Git - lilypond.git/blob - lily/boxes.cc
partial: 1.0.1.jcn
[lilypond.git] / lily / boxes.cc
1 /*
2   boxes.cc -- implement Box
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "boxes.hh"
10 #include "varray.hh"
11
12 void
13 Box::translate (Offset o)
14 {
15   for (Axis i=X_AXIS; i < NO_AXES; incr(i))
16     interval_a_[i] += o[i];
17 }
18
19 void
20 Box::unite (Box b)
21 {
22   for (Axis i=X_AXIS; i < NO_AXES; incr(i))
23     interval_a_[i].unite (b[i]);
24 }
25
26 /**
27   Initialize to empty.
28  */
29 Box::Box()
30 {        
31 }
32
33 Box::Box (Interval ix, Interval iy)
34 {
35   x() = ix;
36   y() = iy;
37 }
38
39 Interval &
40 Box::operator[] (Axis a)
41 {
42   return interval_a_[a];
43 }
44
45 Interval
46 Box::operator[] (Axis a)const
47 {
48   return interval_a_[a];
49 }