Skip to content

Commit 809ad17

Browse files
committed
Fix beam layout case
Multiple switches in a group should only have a slant if both stave's directions match. Also rename misleading variables
1 parent 773e6e3 commit 809ad17

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/engraving/rendering/score/beamtremololayout.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,17 +1008,16 @@ bool BeamTremoloLayout::calculateAnchorsCross(const BeamBase* item, BeamBase::La
10081008
break;
10091009
}
10101010
}
1011+
10111012
const bool overallSlantFlat = overallDirection == 0;
1012-
const bool topSlantMatchesDirection = (topSlantDir != 0 && topSlantDir != overallDirection);
1013-
const bool bottomSlantMatchesDirection = (bottomSlantDir != 0 && bottomSlantDir != overallDirection);
1014-
const bool beamSideSwitchMatchesDirection = (beamSideSwitchDirection != 0 && beamSideSwitchDirection != overallDirection);
1015-
const bool staffSwitchMatchesDirection = (staffSwitchDirection != 0 && staffSwitchDirection != overallDirection);
1016-
1017-
forceHoriz = forceHoriz || overallSlantFlat
1018-
|| (topSlantMatchesDirection
1019-
|| bottomSlantMatchesDirection
1020-
|| beamSideSwitchMatchesDirection
1021-
|| staffSwitchMatchesDirection);
1013+
const bool topSlantOverallDiff = (topSlantDir != 0 && topSlantDir != overallDirection);
1014+
const bool bottomSlantOverallDiff = (bottomSlantDir != 0 && bottomSlantDir != overallDirection);
1015+
const bool beamSideSwitchOverallDiff = (beamSideSwitchDirection != 0 && beamSideSwitchDirection != overallDirection);
1016+
const bool staffSwitchOverallDiff = (staffSwitchDirection != 0 && staffSwitchDirection != overallDirection);
1017+
const bool flattenNeutralStaffSwitch = staffSwitchDirection == 0 && (topSlantDir != bottomSlantDir);
1018+
1019+
forceHoriz = forceHoriz || overallSlantFlat || flattenNeutralStaffSwitch
1020+
|| (topSlantOverallDiff || bottomSlantOverallDiff || beamSideSwitchOverallDiff || staffSwitchOverallDiff);
10221021

10231022
if (!forceHoriz) {
10241023
int slant = 0;

0 commit comments

Comments
 (0)