MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Fix page size on 302 import

Open MarcSabatella opened this issue 2 years ago • 5 comments

Resolves: https://github.com/musescore/MuseScore/issues/14570

The legacy 302 style file has the wrong default page size (Letter instead of A4), causing scores using the A4 default to change to Letter on import.

  • [x] I signed CLA
  • [x] I made sure the code in the PR follows the coding rules
  • [x] I made sure the code compiles on my machine
  • [x] I made sure there are no unnecessary changes in the code
  • [x] I made sure the title of the PR reflects the core meaning of the issue you are solving
  • [x] I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • [x] I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • [ ] I created the test (mtest, vtest, script test) to verify the changes I made

MarcSabatella avatar Nov 23 '22 13:11 MarcSabatella

As far as I know the pagePrintableWidth is correct as is. This would need to be tested on a system for which A4 actually is the default. In MU3, create a score, check the page size and margins (should be A4 and 15 mm), save it, then open in MU4 and verify the page and margins are correct. There have often been small discrepancies in margin size due to round-off error (eg, 15 mm changing to 15.06 mm), but I think this will avoid that.

MarcSabatella avatar Nov 23 '22 13:11 MarcSabatella

@oktophonie - can you do the honours?

Tantacrul avatar Nov 23 '22 23:11 Tantacrul

Having tried this PR (in the manner described above), a migrated score has the correct page size and margins, but I also tried it on a recent nightly build and it worked fine there too. So doesn't this really need to be tested on a system where Letter is the default?

its-not-nice avatar Nov 29 '22 09:11 its-not-nice

Well, testing on a system with A4 being the default is a sanity test, whether that fix broke anything there.

Jojo-Schmitz avatar Nov 29 '22 10:11 Jojo-Schmitz

Hmm, it shouldn't work correctly in a nightly on A4-default systems. But, that could be the rounding error I mentioned actually works around this problem on some systems, by forcing MuseScore to write the page size to the file even though it's ostensibly A4 (just not exactly equal to what the default A4 size is).

But, if you have a 3.6.2 file that truly uses the default - where the page size was not written to the file - it will import into current 4.0 builds as Letter. That's the bug I'm fixing here.

So even if, due to the rounding error, scores you create from scratch on your system have the page size written to the file, plenty of other A4 scores don't have their page sizes written to the file. Here's a random example:

https://musescore.com/user/26911315/scores/9086213

Load this into 3.6.2 and you will see it's A4. Load it into a current 4.0 build and you will see it's Letter (and with badly messed up margins). This PR fixes that and this should be testable on any system.

MarcSabatella avatar Nov 29 '22 22:11 MarcSabatella

🟢 Re-tested in 4.0.2. Remains FIXED.

bkunda avatar Mar 06 '23 10:03 bkunda