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

Page layout incorrect and crash when opening file #17517

Closed
henkdegroot opened this issue May 9, 2023 · 4 comments · Fixed by #17585
Closed

Page layout incorrect and crash when opening file #17517

henkdegroot opened this issue May 9, 2023 · 4 comments · Fixed by #17585
Assignees
Labels
crash Issues involving a crash of MuseScore engraving P1 Priority: High

Comments

@henkdegroot
Copy link

henkdegroot commented May 9, 2023

Issue type

UI bug

Bug description

In 4.0.2:
In the attached score (file: Concierto de aranjuez + drums-incorrect-version.mscz), the last page is not formatted correct.
Concierto de aranjuez + drums-incorrect-version.mscz.zip

Right page margins is not observed.

screenshot-last-page

The previous version of the file (file: Concierto de aranjuez + drums-correct-version.mscz) is showing a correct last page.
Concierto de aranjuez + drums-correct-version.mscz.zip

To get to the incorrect formatted last page, change the SP from 1.55mm to 1.45mm.

I think there are more difference between these files, but this seems to cause the incorrect layout.

Two options to fix this have been found:

  • Move the P dynamic in the Cymbal staff measure 76 slighlty
  • Change the SP to 1.46mm

Both files, when opening in today's master build, are causing a crash.

Steps to reproduce

Open Concierto de aranjuez + drums-incorrect-version.mscz
Change the SP from 1.55mm to 1.45mm.

Screenshots/Screen recordings

See bug description

MuseScore Version

4.0.2, 4.1 master

Regression

No.

Operating system

Windows 11

Additional context

Note that the score was downloaded from ms.com, opened in MS4 and after this reset page formatting, reset all styles to default, reset shapes and positions. Next starting updating to the desired forma/layout I want to have, renamed the parts and generated the parts (and closed them).

@muse-bot muse-bot added the UI Visual issues affecting the UI (not notation) label May 9, 2023
@Eism Eism added engraving and removed UI Visual issues affecting the UI (not notation) labels May 10, 2023
@muse-bot muse-bot assigned oktophonie and unassigned Eism May 10, 2023
@oktophonie oktophonie changed the title Page layout incorrect and crash when opening file in current master version Page layout incorrect and crash when opening file May 10, 2023
@oktophonie
Copy link
Contributor

I can't reproduce the incorrect layout in 4.0.2.
However, the file does indeed crash in master.

@oktophonie oktophonie added crash Issues involving a crash of MuseScore P1 Priority: High labels May 10, 2023
@RomanPudashkin
Copy link
Contributor

@mike-spa the crash seems to be caused by your recent changes (itemToAlign is null):

https://github.com/musescore/MuseScore/pull/17001/files#diff-d7be9048a02d828e02014957da837fb956e2c932db8491faf1747cfebfd35a20R258

@MarcSabatella
Copy link
Contributor

MarcSabatella commented May 12, 2023

If it helps, the score where I am seeing this crash (#17533) began life via MusicXML import around the time of the 4.0 beta, and I had to do a fair amount of cleanup of "mid-measure" dynamics that weren't attached in a meaningful way. Scanning my score, I see a couple I missed, in bar 123 low woodwinds, and sure enough deleting those allows the score to load in master.

Probably it was a bug that the MusicXML import was able to add those dynamics to segments with no notes or rests, but I assume that's something you're planning to support along with the ability to attach hairpins to any beat.

@mike-spa
Copy link
Contributor

I can confirm that the horizontal justification error occurs because there exists a Segment of ChordRest type with duration = 0 (which clearly shouldn't be there). In turn, the reason why that segment exists is that it holds the "p" dynamic in the second to last measure, Cymbal staff. If you delete the "p" or move it, the segment will become empty and thus be deleted, which fixes the layout. I don't think this state can be reached by editing in Musescore, so I would assume that the problem is migration-induced. It would probably need some more investigation. Anyway, I've inserted a check to ignore these spurious segments, which protects the layout.

The crash was just due to a forgotten nullcheck (also fixed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Issues involving a crash of MuseScore engraving P1 Priority: High
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants