X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fplet-spanner.cc;h=6eebc48f04ca0815f3e0f8e851bf275b4d54253f;hb=56d6d541266c300b10a6e1b6c026a7682ad12b61;hp=e68bc00079e91aa5e147eab2140748942655ed54;hpb=5e47fbe9f5a8e10458a9d737d1c35cff2eae6791;p=lilypond.git diff --git a/lily/plet-spanner.cc b/lily/plet-spanner.cc index e68bc00079..6eebc48f04 100644 --- a/lily/plet-spanner.cc +++ b/lily/plet-spanner.cc @@ -24,6 +24,7 @@ Plet_spanner::Plet_spanner () { stem_l_drul_[RIGHT] =0; stem_l_drul_[LEFT] =0; + visibility_i_ = 3; tdef_p_ = new Text_def; tdef_p_->align_i_ = CENTER; @@ -35,6 +36,7 @@ Plet_spanner::Plet_spanner (Plet_spanner const& c) { tdef_p_ = new Text_def (*c.tdef_p_); stem_l_drul_ = c.stem_l_drul_; + visibility_i_ = c.visibility_i_; } Plet_spanner::~Plet_spanner () @@ -46,6 +48,7 @@ Molecule* Plet_spanner::brew_molecule_p () const { Molecule* mol_p = new Molecule; + Real w = width ().length (); Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; @@ -55,14 +58,18 @@ Plet_spanner::brew_molecule_p () const Atom a = paper ()->lookup_l ()->plet (dy_f, w, dir_); a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT])); - mol_p->add (a); + + if (visibility_i_ >= 2) + mol_p->add (a); Real interline_f = paper ()->interline_f (); Real numy_f = (dir_ > 0 ? 0 : -interline_f) + dir_ * interline_f / 2; Atom num (tdef_p_->get_atom (paper (), CENTER)); num.translate (Offset (width ().length ()/ 2 + dx_f_drul_[LEFT], dy_f_drul_[LEFT] + dy_f / 2 + numy_f)); - mol_p->add (num); + + if (visibility_i_ >= 1) + mol_p->add (num); return mol_p; }