From: fred Date: Tue, 26 Mar 2002 23:56:41 +0000 (+0000) Subject: lilypond-1.3.93 X-Git-Tag: release/1.5.59~1271 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=29d939b0d016c8222c477b24dbc90e7fb8fd91b3;p=lilypond.git lilypond-1.3.93 --- diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index f6225e51e1..4810dec72e 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -42,7 +42,6 @@ Breathing_sign::offset_callback (Score_element * b, Axis a) { Score_element * me = (Score_element*)b; - Real space = Staff_symbol_referencer::staff_space (b); Direction d = Directional_element_interface::get (b); if (!d) { @@ -50,7 +49,9 @@ Breathing_sign::offset_callback (Score_element * b, Axis a) Directional_element_interface::set (me, d); } - return 2.0 * space * d; + Real inter_f = Staff_symbol_referencer::staff_space (me)/2; + int sz = Staff_symbol_referencer::line_count (me)-1; + return inter_f * sz * d; } void diff --git a/lily/dots.cc b/lily/dots.cc index c249d6a1cf..25e4cec7dd 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -26,9 +26,7 @@ Dots::quantised_position_callback (Score_element * me, Axis a) if (!Directional_element_interface::get (me)) Directional_element_interface::set (me, UP); - - int pos = int (Staff_symbol_referencer::position_f (me)); - if (!(pos % 2)) + if (Staff_symbol_referencer::on_staffline (me)) return Staff_symbol_referencer::staff_space (me) / 2.0 * Directional_element_interface::get (me); } diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index 82c84cfc6a..129848172b 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -33,6 +33,8 @@ public: static Real staff_space (Score_element*); static Score_element * staff_symbol_l (Score_element*); + static bool on_staffline (Score_element*); + static bool on_staffline (Score_element*,int); static int line_count (Score_element*); static Real position_f (Score_element*); static Real staff_radius (Score_element*); diff --git a/lily/note-head.cc b/lily/note-head.cc index b0b97cb9a7..847799f180 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -60,10 +60,10 @@ Note_head::brew_molecule (SCM smob) Real inter_f = Staff_symbol_referencer::staff_space (me)/2; int sz = Staff_symbol_referencer::line_count (me)-1; - Real p = Staff_symbol_referencer::position_f (me); + int p = (int)Staff_symbol_referencer::position_f (me); int streepjes_i = abs (p) < sz ? 0 - : (abs((int)p) - sz) /2; + : (abs(p) - sz) /2; SCM style = me->get_elt_property ("style"); if (!gh_symbol_p (style)) @@ -89,13 +89,15 @@ Note_head::brew_molecule (SCM smob) ledger.set_empty (true); - int parity = abs(int (p)) % 2; - + Real offs = (Staff_symbol_referencer::on_staffline (me)) + ? 0.0 + : -dir * inter_f; + for (int i=0; i < streepjes_i; i++) { Molecule s (ledger); - s.translate_axis (-dir * inter_f * (i*2 + parity), - Y_AXIS); + s.translate_axis (-dir * inter_f * i*2 + offs, + Y_AXIS); out.add_molecule (s); } } diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index b4a2351ea3..4e70b158b6 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -39,6 +39,19 @@ Staff_symbol_referencer::line_count (Score_element*me) return st ? Staff_symbol::line_count (st) : 0; } +bool +Staff_symbol_referencer::on_staffline (Score_element*me) +{ + return on_staffline (me, (int) position_f (me)); +} + +bool +Staff_symbol_referencer::on_staffline (Score_element*me, int pos) +{ + int sz = line_count (me)-1; + return ((pos + sz) % 2) == 0; +} + Score_element* Staff_symbol_referencer::staff_symbol_l (Score_element*me) {