- int interspaces = Staff_symbol_referencer::line_count (me)-1;
- int pos = Staff_symbol_referencer::get_rounded_position (me);
- if (with_ledgers && interspaces >= 0
- && abs (pos) - interspaces > 1)
- {
- Interval ledger_size = out.extent (X_AXIS);
- ledger_size.widen ( ledger_size.length ()/4);
-
- Real left_shorten =0.0;
- if (Grob * g = unsmob_grob (me->get_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 =
- linear_combination (Drul_array<Real> (me->extent (common, X_AXIS)[LEFT],
- g->extent (common, X_AXIS)[RIGHT]),
-
- 0.5);
-
- left_shorten = (-ledger_size[LEFT] + d) >? 0 ;
-
- /*
- TODO: shorten 2 ledger lines for the case natural +
- downstem.
- */
- }
-
- out.add_stencil (Note_head::brew_ledger_lines (me, pos, interspaces,
- ledger_size,
- left_shorten,
- false));
- }