-
- Interval hp = Stem::head_positions (stem);
- Real chord_start = hp[sd];
- Real stem_end = Stem::stem_end_position (stem);
-
- stem_posns[d] = Interval(chord_start<?stem_end, chord_start>? stem_end);
- head_posns[d].unite (hp);
+
+ Interval hp = Stem::head_positions (stem);
+ if (!hp.is_empty ())
+ {
+ Real chord_start = hp[sd];
+ Real stem_end = Stem::stem_end_position (stem);
+
+ stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start, stem_end));
+ head_posns[d].unite (hp);
+ }