]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest.cc
* lily/rest.cc (polyphonic_offset_callback): new function. Do
[lilypond.git] / lily / rest.cc
index 0d01e41155905843a35a73d5bbca751716700de1..ffc32784b59b2034c1b25227c87daed2a3222abe 100644 (file)
@@ -13,6 +13,7 @@
 #include "dots.hh"
 #include "paper-score.hh"
 #include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
 
 // -> offset callback
 MAKE_SCHEME_CALLBACK (Rest,after_line_breaking,1);
@@ -159,7 +160,17 @@ Rest::extent_callback (SCM smob, SCM ax)
   return ly_interval2scm (unsmob_stencil (m)->extent (a));
 }
 
-
+MAKE_SCHEME_CALLBACK (Rest,polyphonic_offset_callback,2);
+SCM
+Rest::polyphonic_offset_callback (SCM smob, SCM)
+{
+  Grob* me = unsmob_grob (smob);
+  Direction d = get_grob_direction (me);
+  Real off = 2* d ;
+  if(off)
+    off *= Staff_symbol_referencer::staff_space (me);
+  return gh_double2scm (off);
+}
 
 ADD_INTERFACE (Rest,"rest-interface",
   "a rest",