X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstaff-sym.cc;h=abd1addd33145f5f7d1109af4e73fc6bf0ddfe0c;hb=refs%2Ftags%2Frelease%2F1.1.29;hp=ebacee46f730c62499eec09272213c51b09ac7b3;hpb=a0a2265e998de797121d8feb51eb07f561012e6a;p=lilypond.git diff --git a/lily/staff-sym.cc b/lily/staff-sym.cc index ebacee46f7..abd1addd33 100644 --- a/lily/staff-sym.cc +++ b/lily/staff-sym.cc @@ -3,23 +3,25 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--1999 Han-Wen Nienhuys */ #include "staff-sym.hh" #include "lookup.hh" +#include "dimensions.hh" #include "paper-def.hh" #include "molecule.hh" #include "debug.hh" +#include "item.hh" - -Staff_symbol::Staff_symbol (int l) +Staff_symbol::Staff_symbol () { - no_lines_i_ = l; + no_lines_i_ = 5; + interline_f_ = 0 PT; } -IMPLEMENT_IS_TYPE_B1(Staff_symbol,Spanner); + void Staff_symbol::do_print() const @@ -30,20 +32,28 @@ Staff_symbol::do_print() const #endif } +Interval +Staff_symbol::do_height() const +{ + int n = no_lines_i_ -1; +// return 2* inter_note_f () * Interval (-n, n); + return inter_note_f () * Interval (-n, n); +} + Molecule* -Staff_symbol::brew_molecule_p() const +Staff_symbol::do_brew_molecule_p() const { + Real w = extent (X_AXIS).length (); Paper_def * p = paper(); - Atom rule = p->lookup_l ()->rule_symbol (p->get_var ("rule_thickness"), - width ().length ()); - Real inter = p->interline_f (); - Real height = (no_lines_i_-1) * inter/2; + Molecule rule = lookup_l ()->rule_symbol (p->get_var ("rulethickness"), + w); + Real height = (no_lines_i_-1) * inter_note_f(); Molecule * m = new Molecule; for (int i=0; i < no_lines_i_; i++) { - Atom a (rule); - a.translate_axis (height - i * inter, Y_AXIS); - m->add (a); + Molecule a (rule); + a.translate_axis (height - i * inter_note_f()*2, Y_AXIS); + m->add_molecule (a); } return m; @@ -52,6 +62,9 @@ Staff_symbol::brew_molecule_p() const Real Staff_symbol::inter_note_f() const { + if (interline_f_) + return interline_f_/2; + return paper()->internote_f (); }