Skip to content

Commit

Permalink
Merge pull request #10665 from asattely/vertical-displace-articulation
Browse files Browse the repository at this point in the history
[MU4] Fix staccato and tenuto appearing below notes when they shouldn't
  • Loading branch information
RomanPudashkin authored Mar 11, 2022
2 parents 3185a02 + 11701a2 commit 4b092e4
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/engraving/libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3761,12 +3761,20 @@ void Chord::layoutArticulations()
bool headSide = bottom == up();
qreal x = centerX();
qreal y = 0.0;

const qreal halfBeamSp = score()->styleS(Sid::beamWidth).val() * score()->spatium() * 0.5;
if (bottom) {
if (!headSide && stem()) {
y = upPos() + stem()->length();
if (beam()) {
y += score()->styleS(Sid::beamWidth).val() * _spatium * .5;
auto userLen = stem()->userLength();
if (_up) {
y = downPos() - stem()->length() - userLen;
if (beam()) {
y -= halfBeamSp * beam()->mag();
}
} else {
y = upPos() + stem()->length() - userLen;
if (beam()) {
y += halfBeamSp * beam()->mag();
}
}
int line = lrint((y + 0.5 * _spStaff) / _spStaff);
if (line < staffType->lines()) { // align between staff lines
Expand Down Expand Up @@ -3797,9 +3805,17 @@ void Chord::layoutArticulations()
y -= a->height() * .5; // center symbol
} else {
if (!headSide && stem()) {
y = downPos() + stem()->length();
if (beam()) {
y -= score()->styleS(Sid::beamWidth).val() * _spatium * .5;
auto userLen = stem()->userLength();
if (_up) {
y = downPos() - stem()->length() + userLen;
if (beam()) {
y -= halfBeamSp * beam()->mag();
}
} else {
y = upPos() + stem()->length() + userLen;
if (beam()) {
y += halfBeamSp * beam()->mag();
}
}
int line = lrint((y - 0.5 * _spStaff) / _spStaff);
if (line >= 0) { // align between staff lines
Expand Down

0 comments on commit 4b092e4

Please sign in to comment.