From: fred Date: Fri, 20 Dec 1996 23:18:55 +0000 (+0000) Subject: lilypond-0.0.19 X-Git-Tag: release/1.5.59~6535 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7dd37746a51993b0ec9c6962798ec84e5e031b2d;p=lilypond.git lilypond-0.0.19 --- diff --git a/hdr/molecule.hh b/hdr/molecule.hh index 83f8ac1e2c..b5df9ee383 100644 --- a/hdr/molecule.hh +++ b/hdr/molecule.hh @@ -38,7 +38,7 @@ struct Molecule { void add_right(const Molecule &m); void add_left(const Molecule &m); void add_top(const Molecule &m); - void add_bot(const Molecule &m); + void add_bottom(const Molecule &m); void add(Molecule const &m); void translate(Offset); void add(Atom a) { ats.bottom().add(new Atom(a)); } diff --git a/src/molecule.cc b/src/molecule.cc index a664eeb74a..fb72eb6bf0 100644 --- a/src/molecule.cc +++ b/src/molecule.cc @@ -116,7 +116,7 @@ Molecule::add_top(const Molecule &m) } void -Molecule::add_bot(const Molecule &m) +Molecule::add_bottom(const Molecule &m) { if (!ats.size()) { add(m); diff --git a/src/stem.cc b/src/stem.cc index 84e24c5986..03b91b9316 100644 --- a/src/stem.cc +++ b/src/stem.cc @@ -60,7 +60,8 @@ Stem::add(Notehead *n) if ( p < minnote) minnote = p; if ( p> maxnote) - maxnote = p; + maxnote = p; + heads.add(n); } @@ -108,11 +109,29 @@ Stem::set_default_extents() stem_xoffset = 0; } +void +Stem::set_noteheads() +{ + heads.sort(Notehead::compare); + int parity=0; + int lastpos = heads[0]->position; + for (int i=1; i < heads.sz(); i ++) { + if (ABS(lastpos- heads[i]->position) == 1) { + if (parity) + heads[i]->x_dir = (stem_xoffset>0) ? 1:-1; + parity = !parity; + } else + parity = 0; + lastpos = heads[i]->position; + } +} + void Stem::postprocess() { if (bot == top) set_default_extents(); + set_noteheads(); brew_molecole(); } @@ -146,7 +165,7 @@ Stem::brew_molecole() Symbol fl = p->lookup_->flag(flag); Molecule m(fl); if (flag < -4){ - output->add_bot(m); + output->add_bottom(m); } else if (flag > 4) { output->add_top(m); } else