source file of the GNU LilyPond music typesetter
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "misc.hh"
+/*
+ build a ledger line for small pieces.
+ */
+Molecule
+Note_head::ledger_line (Interval xwid) const
+{
+ Drul_array<Molecule> endings;
+ endings[LEFT] = lookup_l()->afm_find ("noteheads-ledgerending");
+ Molecule * e = &endings[LEFT];
+ endings[RIGHT] = *e;
+
+ Real thick = e->dim_[Y_AXIS].length();
+ Real len = e->dim_[X_AXIS].length () - thick;
+
+ Molecule total;
+ Direction d = LEFT;
+ do {
+ endings[d].translate_axis (xwid[d] - endings[d].dim_[X_AXIS][d], X_AXIS);
+ total.add_molecule (endings[d]);
+ } while ((flip(&d)) != LEFT);
+
+ Real xpos = xwid [LEFT] + len;
+
+ while (xpos + len + thick /2 <= xwid[RIGHT])
+ {
+ e->translate_axis (len, X_AXIS);
+ total.add_molecule (*e);
+ xpos += len;
+ }
+
+ return total;
+}
+
void
Note_head::do_pre_processing ()
Staff_symbol_referencer_interface si (this);
Real inter_f = si.staff_space ()/2;
- int sz = si.lines_i ()-1;
+ int sz = si.line_count ()-1;
Real p = si.position_f ();
int streepjes_i = abs (p) < sz
? 0
Interval hd = out->dim_[X_AXIS];
Real hw = hd.length ()/4;
- Molecule ledger
- = lookup_l ()->ledger_line (Interval (hd[LEFT] - hw,
- hd[RIGHT] + hw));
+ Molecule ledger (ledger_line (Interval (hd[LEFT] - hw,
+ hd[RIGHT] + hw)));
int parity = abs(int (p)) % 2;