Skip to content

Fix element stacking during partial layout#32755

Open
CubikingChill wants to merge 1 commit intomusescore:masterfrom
CubikingChill:fix-element-stacking
Open

Fix element stacking during partial layout#32755
CubikingChill wants to merge 1 commit intomusescore:masterfrom
CubikingChill:fix-element-stacking

Conversation

@CubikingChill
Copy link
Contributor

@CubikingChill CubikingChill commented Mar 24, 2026

Elements (text, dynamics) were stacking on top of each other after edits, only returning to correct positions after save/reload. This occurred because partial layout reset only affected the edited measure range while skyline collision detection processed entire systems, creating mixed stale/fresh data.

Changes:

  • Enable position reset in LayoutData::reset() to force clean recalculation
  • Reset autoplace state to ensure proper collision detection
  • Expand PassResetLayoutData to reset all measures in affected systems, not just the edited range

Fixes the mismatch between partial reset scope and full system processing.

Resolves: #32756

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@shoogle shoogle marked this pull request as draft March 24, 2026 12:40
@shoogle
Copy link
Contributor

shoogle commented Mar 24, 2026

Please keep PRs as draft until all checks have passed.

  • Unit tests: Search the log for @@ to find diffs where your code produced different output to the reference files in the repository. Once you've fixed those, if it still fails, search for fail and error to fix other kinds of failures (but these will return some false positives like non-fatal main_thread errors not related to the tests).
  • Visual tests: Download the Comparison artifact from the Summary page inspect the files inside.

Also see the wiki page: Fix the CI checks.

Elements (text, dynamics) were stacking after edits because autoplace
collision detection used stale offset state. Clear autoplace state
(offsetChanged, changedPos) during layout reset to force fresh collision
detection without resetting positions.
@avvvvve avvvvve requested a review from mike-spa March 24, 2026 15:06
@CubikingChill
Copy link
Contributor Author

Please keep PRs as draft until all checks have passed.

* **Unit tests:** Search the [log](https://github.com/musescore/MuseScore/actions/runs/23485663815/job/68340449428?pr=32755) for `@@` to find diffs where your code produced different output to the reference files in the repository. Once you've fixed those, if it still fails, search for `fail` and `error` to fix other kinds of failures (but these will return some false positives like non-fatal `main_thread` errors not related to the tests).

* **Visual tests:** Download the Comparison artifact from the [Summary page](https://github.com/musescore/MuseScore/actions/runs/23485663796) inspect the files inside.

Also see the wiki page: Fix the CI checks.

Thanks for reminding.

@CubikingChill CubikingChill marked this pull request as ready for review March 24, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Element Stacking Bug During Partial Layout

2 participants