#include "staff-symbol-referencer.hh"
#include "note-column.hh"
#include "stem.hh"
-
-bool
-Staff_spacing::has_interface (Grob* g)
-{
- return g && g->has_interface (ly_symbol2scm ("staff-spacing-interface"));
-}
+#include "accidental-placement.hh"
/*
Insert some more space for the next note, in case it has a stem in
Item *col =dynamic_cast<Item*> (g)->column_l ();
Real max_corr = 0. >? (- g->extent (col, X_AXIS)[LEFT]);
+
+ /*
+ Duh. If this gets out of hand, we should invent something more generic.
+ */
if (Grob * a = Note_column::accidentals (g))
+ {
+ Interval v= Accidental_placement::get_relevant_accidental_extent
+ (a, col, me);
+
+ max_corr = max_corr >? (- v[LEFT]);
+ }
+ if (Grob* a = unsmob_grob (g->get_grob_property ("arpeggio")))
{
max_corr = max_corr >? (- a->extent (col, X_AXIS)[LEFT]);
}
-
+
/*
Let's decrease the space a little if the problem is not located
after a barline.
*fixed = 1.0;
Grob * separation_item=0;
-
+ Item * me_item = dynamic_cast<Item*> (me);
+
for (SCM s = me->get_grob_property ("left-items");
gh_pair_p (s); s = gh_cdr(s))
{
if (!scm_list_p (alist))
return ;
- SCM space_def = scm_sloppy_assq (ly_symbol2scm ("begin-of-note"), alist);
+
+ SCM space_def = scm_sloppy_assq (ly_symbol2scm ("first-note"), alist);
+ if (me_item->break_status_dir () == CENTER)
+ {
+ SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist);
+ if (gh_pair_p (nndef ))
+ space_def = nndef;
+ }
+
if (!gh_pair_p (space_def))
{
programming_error ("Unknown prefatory spacing. ");
*space += next_notes_correction (me, last_grob);
-
- if (dynamic_cast<Item*> (me)-> break_status_dir () == RIGHT)
- {
- /* Start of line: this space is not stretchable */
- *fixed = *space;
- }
-
}
+
+
+ADD_INTERFACE (Staff_spacing,"staff-spacing-interface",
+ "",
+ "stem-spacing-correction left-items right-items");