- int interspaces = Staff_symbol_referencer::line_count (me)-1;
- int pos = (int)rint (Staff_symbol_referencer::get_position (me));
- if (with_ledgers && interspaces >= 0
- && abs (pos) - interspaces > 1)
- {
- Interval hd = out.extent (X_AXIS);
- Real left_ledger_protusion = hd.length ()/4;
- Real right_ledger_protusion = left_ledger_protusion;
-
- if (Grob * g = unsmob_grob(me->get_grob_property ("accidental-grob")))
- {
- /*
- make a little room for accidentals.
-
- TODO: this will look silly if a chord has ledger lines,
- and only the bottom note has an accidental.
- */
-
- Grob *common = g->common_refpoint (me, X_AXIS);
- Real d =
- me->extent (common, X_AXIS)[LEFT]
- -g->extent (common, X_AXIS)[RIGHT];
-
- left_ledger_protusion = left_ledger_protusion <? (d/2);
- }
-
- Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion,
- hd[RIGHT] + right_ledger_protusion);
- out.add_molecule (Note_head::brew_ledger_lines (me, pos, interspaces,
- l_extents, false));
- }