- Grob *dot_wipe_head = nu;
-
- if (upball_type == dnball_type)
- {
- if (Rhythmic_head::dot_count (nd) < Rhythmic_head::dot_count (nu))
- {
- wipe_ball = nd;
- dot_wipe_head = nd;
- }
- else if (Rhythmic_head::dot_count (nd) > Rhythmic_head::dot_count (nu))
- {
- dot_wipe_head = nu;
- wipe_ball = nu;
- }
- else
- {
- dot_wipe_head = nu;
- }
- }
- else if (dnball_type > upball_type)
- {
- wipe_ball = nd;
- dot_wipe_head = nd;
- }
- else if (dnball_type < upball_type)
- {
- wipe_ball = nu;
- dot_wipe_head = nu;
- }
+ Grob *dot_wipe_head = head_up;
+
+ if (up_ball_type == down_ball_type)
+ {
+ if (Rhythmic_head::dot_count (head_down) < Rhythmic_head::dot_count (head_up))
+ {
+ wipe_ball = head_down;
+ dot_wipe_head = head_down;
+ }
+ else if (Rhythmic_head::dot_count (head_down) > Rhythmic_head::dot_count (head_up))
+ {
+ dot_wipe_head = head_up;
+ wipe_ball = head_up;
+ }
+ else
+ dot_wipe_head = head_up;
+ }
+ else if (down_ball_type > up_ball_type)
+ {
+ wipe_ball = head_down;
+ dot_wipe_head = head_down;
+ }
+ else if (down_ball_type < up_ball_type)
+ {
+ wipe_ball = head_up;
+ dot_wipe_head = head_up;
+ /*
+ If upper head is eighth note or shorter, and lower head is half note,
+ shift by the difference between the open and filled note head widths,
+ otherwise upper stem will be misaligned slightly.
+ */
+ if (Stem::duration_log (stems[DOWN]) == 1
+ && Stem::duration_log (stems[UP]) >= 3)
+ shift_amount = (1 - head_up->extent (head_up, X_AXIS).length ()
+ / head_down->extent (head_down, X_AXIS).length ()) * 0.5;
+ }