(Which properties to
[lilypond.git] / lily / rod.cc
blobd79fd7f772e7774ab14f8653078a2b0670fdddc2
1 /*
2 rod.cc -- implement Rod, Column_rod
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
9 #include "rod.hh"
10 #include "paper-column.hh"
11 #include "warn.hh"
12 #include "dimensions.hh"
13 #include "spaceable-grob.hh"
15 Rod::Rod ()
17 distance_ = 0.0;
18 item_l_drul_[LEFT] = item_l_drul_[RIGHT] =0;
23 void
24 Rod::columnize ()
26 Direction d = LEFT;
27 do {
28 Paper_column * pc = item_l_drul_[d]->get_column ();
29 distance_ += - d * item_l_drul_[d]->relative_coordinate (pc, X_AXIS);
30 item_l_drul_[d] = pc;
31 } while ((flip (&d))!=LEFT);
35 void
36 Rod::add_to_cols ()
38 columnize ();
39 if (item_l_drul_[LEFT] != item_l_drul_[RIGHT])
40 Spaceable_grob::add_rod (item_l_drul_[LEFT],
41 item_l_drul_[RIGHT],
42 distance_);