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

Fix old project migration bugs #17983

Merged
merged 3 commits into from Jun 26, 2023

Conversation

mike-spa
Copy link
Contributor

Resolves: #17982

The bug happens because the position of some items (in this case hairpins) is reset when migrating from version 2.x, but we don't call a new layout after that, so the items aren't rendered properly until a relayout happens. ProjectMigrator::migrateProject should be responsible for calling this layout. In fact, I think it was designed to do so as it calls score->endCmd(), but was being blocked by _updatesLocked.
In turn, there was a pointless layout call being made at the end of Read206, which I've removed.

@mike-spa mike-spa requested a review from oktophonie June 14, 2023 14:50
@oktophonie oktophonie changed the title Fix old projext migration bugs Fix old project migration bugs Jun 14, 2023
oktophonie
oktophonie previously approved these changes Jun 14, 2023
@oktophonie oktophonie added the vtests This PR produces approved changes to vtest results label Jun 15, 2023
@oktophonie oktophonie requested review from RomanPudashkin and removed request for RomanPudashkin June 15, 2023 13:29
@@ -142,6 +142,7 @@ Ret ProjectMigrator::migrateProject(engraving::EngravingProjectPtr project, cons
return make_ret(Ret::Code::InternalError);
}

score->lockUpdates(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to make sure that this change won't cause performance issues when opening old scores (because before we called score->update() a lot of times and this caused a big slowdown)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Performance should be unaffected, because I've added an update() call here, but I've also removed an update() call from Read206::readScore(), where it was unnecessary. I've run the profiler, and performance looks the same, with a total of 2 update() calls in both cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this line to NotationProject::doLoad? It's very confusing to see it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done! 👍

@RomanPudashkin RomanPudashkin merged commit 99abe65 into musescore:master Jun 26, 2023
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.

First layout of old score is incorrect
3 participants