Skip to content

Commit 22063aa

Browse files
committed
todo squash
1 parent cd898d1 commit 22063aa

File tree

1 file changed

+5
-26
lines changed

1 file changed

+5
-26
lines changed

src/engraving/libmscore/chord.cpp

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,53 +4026,32 @@ void Chord::layoutArticulations2(bool layoutOnCrossBeamSide)
40264026
}
40274027
}
40284028
}
4029-
Articulation* stacc = nullptr;
4029+
40304030
for (Articulation* a : _articulations) {
4031-
double kearnHeight = 0.0;
4032-
if (a->isStaccato()) {
4033-
stacc = a;
4034-
} else if (stacc && a->isAccent() && stacc->up() == a->up()
4035-
&& (RealIsEqualOrLess(stacc->ypos(), 0.0) || RealIsEqualOrMore(stacc->ypos(), staff()->height()))) {
4036-
kearnHeight = stacAccentKern;
4037-
} else {
4038-
stacc = nullptr;
4039-
}
4040-
double x = (up() != a->up() || !a->isBasicArticulation()) ? headSideX : stemSideX;
40414031
if (layoutOnCrossBeamSide && !a->isOnCrossBeamSide()) {
40424032
continue;
40434033
}
40444034
ArticulationAnchor aa = a->anchor();
4045-
if (aa != ArticulationAnchor::TOP_CHORD && aa != ArticulationAnchor::BOTTOM_CHORD) {
4035+
if (!a->layoutCloseToNote() || aa == ArticulationAnchor::TOP_STAFF || aa == ArticulationAnchor::BOTTOM_STAFF) {
40464036
continue;
40474037
}
4048-
4038+
double x = (up() != a->up() || !a->isBasicArticulation()) ? headSideX : stemSideX;
40494039
if (a->up()) {
4050-
if (!a->layoutCloseToNote()) {
4051-
a->layout();
4052-
a->setPos(x, chordTopY + kearnHeight);
4053-
a->doAutoplace();
4054-
}
40554040
if (a->visible()) {
40564041
chordTopY = a->y() - a->height() - minDist;
40574042
}
40584043
} else {
4059-
if (!a->layoutCloseToNote()) {
4060-
a->layout();
4061-
a->setPos(x, chordBotY + abs(a->bbox().top()) - kearnHeight);
4062-
a->doAutoplace();
4063-
}
40644044
if (a->visible()) {
40654045
chordBotY = a->y() + a->height() + minDist;
40664046
}
40674047
}
40684048
}
4069-
40704049
//
4071-
// now place all articulations with staff top or bottom anchor
4050+
// now place all articulations with staff top or bottom anchor, or chord anchor for artics that don't layout close to note
40724051
//
40734052
staffTopY = std::min(staffTopY, chordTopY);
40744053
staffBotY = std::max(staffBotY, chordBotY);
4075-
stacc = nullptr;
4054+
Articulation* stacc = nullptr;
40764055
for (Articulation* a : _articulations) {
40774056
double kearnHeight = 0.0;
40784057
if (layoutOnCrossBeamSide && !a->isOnCrossBeamSide()) {

0 commit comments

Comments
 (0)