Issue 4182: avoid checking the offset of cross-staff stems too early

Calculating the 'X-offset of a cross-staff Stem too early causes the
Stem's 'direction property to be accessed while it is still
"calculation-in-progress" - always returning "UP". This causes the
X-offset to be set incorrectly when the eventual stem direction will be
"DOWN".

This problem occurs in the scenario where the X-offset of a notehead is
calculated early, when NoteHead::stem_x_shift calls
Stem::calc_positioning_done (via get_property).

Update NoteHead::stem_x_shift to only check a stem's "positioning-done"
property if it is not cross-staff. This will prevent the above scenario
from triggering the problem. The Stem's offset will be calculated again
later anyway, and this does not change the return value of
NoteHead::stem_x_shift as it always returns 0.

Add a suitable regression test.

https://codereview.appspot.com/554030043


---

** [issues:#4182] dynamics on skips confuse cross-staff stems**

**Status:** Started
**Created:** Fri Oct 31, 2014 09:21 PM UTC by Anonymous
**Last Updated:** Thu May 07, 2020 10:28 AM UTC
**Owner:** nobody
**Attachments:**

- 
[stem.png](https://sourceforge.net/p/testlilyissues/issues/4182/attachment/stem.png)
 (6.0 kB; image/png)


*Originally created by:* *anonymous

*Originally created by:* 
[k-ohara5...@oco.net](http://code.google.com/u/110197288862747384800/)

Sometime since ver 2.18, dynamics on skips began to make cross-staff stems 
point the wrong way.   The ledger line seems to be necessary for the bug.

up = \change Staff = "up"
dn = \change Staff = "down"
\new PianoStaff \transpose c c' << \time 2/4
  \new Staff = "up"  
    s2
  \new Staff = "down" <<  
    \{s8\*3 s8\p  \} 
    \{ g8\[ \up e \dn g \up c\] \} >> >


---

Sent from sourceforge.net because testlilyissues-a...@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/testlilyissues/admin/issues/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.
_______________________________________________
Testlilyissues-auto mailing list
testlilyissues-a...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto
  • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development

Reply via email to