]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/breathing-sign.cc
release: 1.3.38
[lilypond.git] / lily / breathing-sign.cc
index bf1f8dea96e3207c4d7158f0266766a20fe6520a..2c1f5152491c973f261c2823915eebed4e5502df 100644 (file)
@@ -5,10 +5,11 @@
 
   written for the GNU LilyPond music typesetter
 
-TODO: --> see breathing-sign-engraver.cc
+  TODO: --> see breathing-sign-engraver.cc
 
 */
 #include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
 
 #include "breathing-sign.hh"
 #include "string.hh"
@@ -22,31 +23,32 @@ TODO: --> see breathing-sign-engraver.cc
 
 Breathing_sign::Breathing_sign ()
 {
-  set_direction (UP);
   set_elt_property ("breakable", SCM_BOOL_T);
 }
 
-
-
-Molecule*
-Breathing_sign::do_brew_molecule_p () const
+Molecule 
+Breathing_sign::do_brew_molecule () const
 {
   Staff_symbol_referencer_interface si (this);
   
-  Real dl = si.staff_line_leading_f();
-  Interval i1(0, dl / 6), i2(-dl / 2, dl / 2);
+  Real space = si.staff_space();
+  Interval i1(0, space / 6), i2(-space / 2, space / 2);
   Box b(i1, i2);
 
-  Molecule *output = new Molecule (lookup_l()->filledbox(b));
-
-  return output;
+  return lookup_l()->filledbox(b);
 }
 
 void
-Breathing_sign::do_post_processing()
+Breathing_sign::after_line_breaking ()
 {
-  Real dl = Staff_symbol_referencer_interface (this).staff_line_leading_f();
-
-  translate_axis(2.0 * dl * get_direction (), Y_AXIS);
+  Real space = staff_symbol_referencer (this).staff_space();
+  Direction d = directional_element (this). get ();
+  if (!d)
+    {
+      d = UP;
+      directional_element(this).set (d);
+    }
+
+  translate_axis(2.0 * space * d, Y_AXIS);
 }