Skip to content

Commit

Permalink
fix musescore#25384: grace note spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Apr 19, 2014
1 parent 689ecfa commit a99b32f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,10 @@ void Chord::layoutPitched()

Accidental* accidental = note->accidental();
if (accidental) {
qreal x = accidental->x() + note->x();
// convert x position of accidental to segment coordinate system
qreal x = accidental->x() + note->x() + note->chord()->x();
if (_noteType == NOTE_NORMAL)
x += note->chord()->x();
x -= score()->styleS(ST_accidentalDistance).val() * _spatium;
lll = qMax(lll, -x);
}
Expand Down Expand Up @@ -1724,7 +1726,7 @@ void Chord::layoutPitched()
for (int i = n-1; i >= 0; --i) {
Chord* c = _graceNotes[i];
x -= c->space().rw();
c->setPos(x, 0);
c->setPos(x - ipos().x(), 0);
x -= c->space().lw() + minNoteDistance * graceMag;
}
if (-x > _space.lw())
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else
chord-layout-1 chord-layout-2 chord-layout-3 chord-layout-4 chord-layout-5\
chord-layout-6 chord-layout-7 chord-layout-8 chord-layout-9\
accidental-1 accidental-2 accidental-3 accidental-4 accidental-5 accidental-6\
tie-1"
tie-1 grace-1"
fi

DPI=130
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set SRC=mmrest-1,bravura-mmrest,mmrest-2,mmrest-4,mmrest-5,mmrest-6,mmrest-7,mmr
chord-layout-1,chord-layout-2,chord-layout-3,chord-layout-4,chord-layout-5, ^
chord-layout-6,chord-layout-7,chord-layout-8,chord-layout-9, ^
accidental-1,accidental-2,accidental-3,accidental-4,accidental-5,accidental-6, ^
tie-1
tie-1,grace-1

set MSCORE=..\win32install\bin\mscore.exe
set DPI=130
Expand Down
Binary file added vtest/grace-1-ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vtest/grace-1.mscz
Binary file not shown.

0 comments on commit a99b32f

Please sign in to comment.