]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/arpeggio.cc
Imported Upstream version 2.18.0
[lilypond.git] / lily / arpeggio.cc
index 96b6bbd3d5e3be8ee09313fed12249c3f0c2e372..4de173da061b38b32d4c7652291ad3c290cd5514 100644 (file)
@@ -56,6 +56,29 @@ Arpeggio::get_common_y (Grob *me)
   return common;
 }
 
+MAKE_SCHEME_CALLBACK (Arpeggio, calc_cross_staff, 1);
+SCM
+Arpeggio::calc_cross_staff (SCM grob)
+{
+  Grob *me = unsmob_grob (grob);
+
+  extract_grob_set (me, "stems", stems);
+  Grob *vag = 0;
+
+  for (vsize i = 0; i < stems.size (); i++)
+    {
+      if (!i)
+        vag = Grob::get_vertical_axis_group (stems[i]);
+      else
+        {
+          if (vag != Grob::get_vertical_axis_group (stems[i]))
+            return SCM_BOOL_T;
+        }
+    }
+
+  return SCM_BOOL_F;
+}
+
 MAKE_SCHEME_CALLBACK (Arpeggio, calc_positions, 1);
 SCM
 Arpeggio::calc_positions (SCM grob)
@@ -140,7 +163,7 @@ Arpeggio::print (SCM smob)
   if (dir)
     {
       Font_metric *fm = Font_interface::get_default_font (me);
-      arrow = fm->find_by_name ("scripts.arpeggio.arrow." + to_string (dir));
+      arrow = fm->find_by_name ("scripts.arpeggio.arrow." + ::to_string (dir));
       heads[dir] -= dir * arrow.extent (Y_AXIS).length ();
     }
 
@@ -169,7 +192,7 @@ Arpeggio::brew_chord_bracket (SCM smob)
   Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
   Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
   Real dy = heads.length () + sp;
-  Real x = 0.7;
+  Real x = robust_scm2double (me->get_property ("protrusion"), 0.4);
 
   Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt));
   mol.translate_axis (heads[LEFT] - sp / 2.0, Y_AXIS);
@@ -227,9 +250,10 @@ ADD_INTERFACE (Arpeggio,
 
                /* properties */
                "arpeggio-direction "
+               "dash-definition " // TODO: make apply to non-slur arpeggios
                "positions "
+               "protrusion "
                "script-priority " // TODO: make around-note-interface
                "stems "
-               "dash-definition " // TODO: make apply to non-slur arpeggios
               );