Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved distances and centering of cross-staff beams #23575

Conversation

mike-spa
Copy link
Contributor

Resolves: #23553

The minimum staff distance for cross-staff beams is computed by summing the minimum allowed stem length of the lowest note above and highest note below the beam. My original implementation however didn't take into account that stems from above and from below overlap each other within the height of the beam itself, hence why the resulting space was excessive.
Additionally, we now measure the distance between first and last beam segment (which for cross-staff beams can be both above and below the beam centerline) and use it to center the beam more precisely.

The action of the fixed-width spacer is now also restored, which allows to fine tune if necessary.

@mike-spa mike-spa force-pushed the improvedDistancesAndCenteringOfCrossStaffBeams branch from fad9643 to 1b9c049 Compare July 12, 2024 09:07
@oktophonie oktophonie added the vtests This PR produces approved changes to vtest results label Jul 12, 2024
@@ -2404,30 +2405,50 @@ double SystemLayout::minVertSpaceForCrossStaffBeams(System* system, staff_idx_t
if (!beam || !beam->cross() || !beam->autoplace() || beam->elements().front() != item) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small suggestion for efficiency - as we now cache the beams cross staff position (above/below/between), this can be checked here
... || beam->ldata()->crossStaffBeamPos != BeamBase::CrossStaffBeamPosition::BETWEEN)

@mike-spa mike-spa force-pushed the improvedDistancesAndCenteringOfCrossStaffBeams branch from 1b9c049 to 98d3f04 Compare July 15, 2024 07:37
@miiizen miiizen merged commit 964ac95 into musescore:master Jul 15, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vtests This PR produces approved changes to vtest results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross-stave beams creating too much vertical space
3 participants