X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbreathing-sign.cc;h=0b9758edc38ae7eb035202e489bcae642368927c;hb=fbb6d20e9f58d691ffe845284cbb4d8bacf9ca60;hp=7c8e44b4e5add4d08bc6b418d6b14be8216fa667;hpb=2873636a53f0011f837aaf6e2072de602730d957;p=lilypond.git diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 7c8e44b4e5..0b9758edc3 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -8,6 +8,8 @@ TODO: --> see breathing-sign-engraver.cc */ +#include "staff-symbol-referencer.hh" +#include "directional-element-interface.hh" #include "breathing-sign.hh" #include "string.hh" @@ -21,38 +23,32 @@ TODO: --> see breathing-sign-engraver.cc Breathing_sign::Breathing_sign () { - dir_ = UP; set_elt_property ("breakable", SCM_BOOL_T); - set_elt_property ("visibility-lambda", - ly_ch_C_eval_scm ("non_postbreak_visibility")); } -void -Breathing_sign::set_vertical_position (Direction updown) +Molecule +Breathing_sign::do_brew_molecule () const { - assert(updown >= -1 && updown <= +1); - - if(updown != 0) - dir_ = updown; -} - -Molecule* -Breathing_sign::do_brew_molecule_p () const -{ - Real dl = staff_line_leading_f(); - Interval i1(0, dl / 6), i2(-dl / 2, dl / 2); + Staff_symbol_referencer_interface si (this); + + 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_line_leading_f(); - - translate_axis(2.0 * dl * dir_, 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); }