X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frod.cc;h=a10ba753db70694b2b1b16868253bccb88bef1b8;hb=31de5573a9c7e3a69b5ab67e2b0734ba88285b64;hp=0bb861423271231cb8eddaf2a069b52b5080b51f;hpb=4fabc68182cab7149d2a4b52502e180f57199831;p=lilypond.git diff --git a/lily/rod.cc b/lily/rod.cc index 0bb8614232..a10ba753db 100644 --- a/lily/rod.cc +++ b/lily/rod.cc @@ -3,49 +3,42 @@ source file of the GNU LilyPond music typesetter - (c) 1998--1999 Han-Wen Nienhuys + (c) 1998--2003 Han-Wen Nienhuys */ #include "rod.hh" -#include "p-col.hh" -#include "debug.hh" +#include "paper-column.hh" +#include "warn.hh" #include "dimensions.hh" -#include "single-malt-grouping-item.hh" - +#include "spaceable-grob.hh" Rod::Rod () { - distance_f_ = 0.0; + distance_ = 0.0; item_l_drul_[LEFT] = item_l_drul_[RIGHT] =0; } + + void -Column_rod::print () const +Rod::columnize () { -#ifndef NDEBUG - DOUT << "Column_rod { rank = " - << other_l_->rank_i () << ", dist = " << distance_f_ << "}\n"; -#endif -} + Direction d = LEFT; + do { + Paper_column * pc = item_l_drul_[d]->get_column (); + distance_ += - d * item_l_drul_[d]->relative_coordinate (pc, X_AXIS); + item_l_drul_[d] = pc; + } while ((flip (&d))!=LEFT); -Column_rod::Column_rod () -{ - distance_f_ = 0; - other_l_ = 0; -} - -int -Column_rod::compare (const Column_rod &r1, const Column_rod &r2) -{ - return r1.other_l_->rank_i() - r2.other_l_->rank_i(); } + void Rod::add_to_cols () { - Direction d = LEFT; - do { - item_l_drul_[-d]->column_l ()->add_rod - (item_l_drul_[d]->column_l (), distance_f_); - }while ((flip (&d))!=LEFT); + columnize (); + if (item_l_drul_[LEFT] != item_l_drul_[RIGHT]) + Spaceable_grob::add_rod (item_l_drul_[LEFT], + item_l_drul_[RIGHT], + distance_); }