Down-stem flipped grace notes are misplaced

• Jul 22, 2013 - 22:58
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Context: commit f34b1c4dd (2013-07-22), self-compiled under Mint 14.

Step: load the attached sample score.

Result:
flip_grace_notes_1.png

Expected result:
flip_grace_notes_2.png

Note:
The issue seems to be caused by commit [http://github.com/musescore/MuseScore/commit/3c729d0e6d5715cc0d2f2df9f5…|3c729d0e] added on 2013-07-18 to fix #21893: Noteheads collide; this commit turned line 1549 from:
qreal x1 = note->pos().x();
to
qreal x1 = note->pos().x() + ipos().x();
This is fine for normal-note chords, but grace chords have a negative x-pos, as their position is relative to the main chord. As a consequence, the rrr value for grace chords remains set to 0 (line 1551).

When the main chord is laid out, the child grace chord is moved to the left by the minNoteDistance value only (line 1627) ignoring the grace head width. This applies to 'normal' (unflipped) gace notes, but for down-stemmed graces, the width of the hook is taken into account (lines 1604-1615) and adds some more space.

The suggested fix is to change line 1549 into:

qreal x1 = note->pos().x();
if (_noteType == NOTE_NORMAL)
      x1 += ipos().x();

Thanks,

M.

Attachment Size
flip_grace_notes_1.png 2.4 KB
flip_grace_notes_2.png 2.39 KB
test_grace_notes.mscx 10.78 KB

Comments