]> git.donarmstrong.com Git - lilypond.git/commitdiff
Prevent x-staff cycles due to Scripts.
authorJoe Neeman <joeneeman@gmail.com>
Fri, 9 Feb 2007 20:40:11 +0000 (22:40 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Fri, 9 Feb 2007 20:40:11 +0000 (22:40 +0200)
lily/include/script-interface.hh
lily/script-interface.cc
scm/define-grobs.scm

index 39e0388331705c2bd550f9a033b9ab9099ef0496..12ba90a8fe5edbce261e4f172250c9a73824833a 100644 (file)
@@ -24,6 +24,7 @@ public:
   DECLARE_GROB_INTERFACE();
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
 };
 
 void make_script_from_event (Grob *p,  Context *tg,
index ff77193f179def3ba646fcdb507993a7036cf942..faa5504942df6d41e191aeec6da866b404ea68b4 100644 (file)
@@ -65,6 +65,15 @@ Script_interface::calc_direction (SCM smob)
   return scm_from_int (d);
 }
 
+MAKE_SCHEME_CALLBACK (Script_interface, calc_cross_staff, 1);
+SCM
+Script_interface::calc_cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Grob *stem = Note_column::get_stem (me->get_parent (X_AXIS));
+  return stem->get_property ("cross-staff");
+}
+
 MAKE_SCHEME_CALLBACK (Script_interface, print, 1);
 
 SCM
index 98d09dc9bfbc5c0790c0ad26e589657b45c17d49..79119aed96cf874b4651a87d84f5fa46509be547 100644 (file)
        (stencil . ,ly:script-interface::print)
        (direction . ,ly:script-interface::calc-direction)
        (font-encoding . fetaMusic)
+       (cross-staff . ,ly:script-interface::calc-cross-staff)
        (meta . ((class . Item)
                 (interfaces . (script-interface
                                side-position-interface