From: fred Date: Sun, 24 Mar 2002 20:01:17 +0000 (+0000) Subject: lilypond-0.1.27 X-Git-Tag: release/1.5.59~3675 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f83b4ef17fe8745962bf6bf3c102c682c1c1b6f2;p=lilypond.git lilypond-0.1.27 --- diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index d4f8663c35..d0616359e2 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -31,12 +31,7 @@ struct Lookup { /// round slope to closest TeXslope Atom beam (Real&,Real) const; - /** - pos == 3 : 3 lines above staff (extending below note) - - pos == -3: below staff - */ - Atom streepjes (int type, int pos) const; + Atom streepje (int type) const; Atom vbrace (Real &dy) const; Atom meter (Array) const; diff --git a/lily/lookup.cc b/lily/lookup.cc index 9b7ec861c4..bf432c3d11 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -145,35 +145,14 @@ Lookup::flag (int j, Direction d) const } Atom -Lookup::streepjes (int type, int i) const +Lookup::streepje (int type) const { - assert (i); + if (type > 2) + type = 2; - int arg; - String idx; - - if (i < 0) - { - idx = "botlines"; - arg = -i; - } - else - { - arg = i; - idx = "toplines"; - } - - // ugh - Real w = ball (type).dim_[X_AXIS].length (); - - Atom ret = (*symtables_)("streepjes")->lookup (idx); - - Array a; - a.push (String (w) + "pt"); - a.push (arg); - ret.tex_ = substitute_args (ret.tex_, a); - - return ret; + Symtable * st = (*symtables_)("balls"); + + return st->lookup (String (type) + 'l'); } Atom diff --git a/lily/note-head.cc b/lily/note-head.cc index 529e28d895..7a728aaa82 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -61,7 +61,7 @@ Note_head::brew_molecule_p() const Real inter_f = p->internote_f (); // ugh - int streepjes_i = abs(position_i_) < staff_size_i_/2 + int streepjes_i = abs (position_i_) < staff_size_i_/2 ? 0 : (abs(position_i_) - staff_size_i_/2) /2; @@ -72,14 +72,18 @@ Note_head::brew_molecule_p() const if (streepjes_i) { int dir = sign (position_i_); + Atom streepje = p->lookup_l ()->streepje (balltype_i_); + + int parity = (position_i_ % 2) ? 1 : 0; - Atom streepje = p->lookup_l()->streepjes (balltype_i_, dir* streepjes_i); - - Molecule sm; - sm.add (streepje); - if (position_i_ % 2) - sm.translate_axis (-inter_f* dir, Y_AXIS); - out->add (sm); + + for (int i=0; i < streepjes_i; i++) + { + Atom s = streepje; + s.translate_axis (-dir * inter_f * (i*2 + parity), + Y_AXIS); + out->add (s); + } } out->translate_axis (inter_f*position_i_, Y_AXIS);