Skip to content

Fix #33713: Full-measure rest collides with its own fermata#33790

Open
pyonpyoco wants to merge 3 commits into
musescore:mainfrom
pyonpyoco:whole-measure-rest-with-fermata
Open

Fix #33713: Full-measure rest collides with its own fermata#33790
pyonpyoco wants to merge 3 commits into
musescore:mainfrom
pyonpyoco:whole-measure-rest-with-fermata

Conversation

@pyonpyoco

Copy link
Copy Markdown
Contributor

Resolves: #33713

Problem

The issue was caused by checkFullMeasureRestCollisions(). It removed the full-measure rest itself from measureShape, but did not remove the fermata associated with that same rest. As a result, the full-measure rest was checked against its own fermata and moved during collision avoidance.

Solution

Exclude fermatas on the same segment and track as the full-measure rest being checked.

2026-06-12.165224.mp4
  • I signed the CLA as username:
  • 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.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7e21e549-ee2f-44cc-8805-fc8995fdd4c6

📥 Commits

Reviewing files that changed from the base of the PR and between b385c2b and 2bccead.

📒 Files selected for processing (1)
  • src/engraving/rendering/score/restlayout.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/engraving/rendering/score/restlayout.cpp

📝 Walkthrough

Walkthrough

This PR updates collision detection in the full-measure rest layout engine. The measureShape.remove_if predicate in RestLayout::checkFullMeasureRestCollisions now captures fullMeasureRest and extends its removal logic to exclude FERMATA elements whose explicitParent segment and track match the full-measure rest, preventing those fermata symbols from being considered in measureShape collision checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main problem being fixed: a full-measure rest colliding with its own fermata.
Description check ✅ Passed The description includes the issue reference, clear problem and solution sections, supporting video, and all required checklist items are completed except the unit test item.
Linked Issues check ✅ Passed The code change directly addresses issue #33713 by excluding fermatas from collision detection for full-measure rests, implementing the stated solution approach.
Out of Scope Changes check ✅ Passed The single-line change is narrowly focused on the collision detection logic, directly addressing the linked issue with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped musescore/muse_framework.git.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mathesoncalum mathesoncalum requested a review from mike-spa June 12, 2026 11:32
return shapeItem && ((shapeItem->isRest() && toRest(shapeItem)->isFullMeasureRest())
|| (shapeItem->type() == ElementType::FERMATA
&& shapeItem->explicitParent() == fullMeasureRest->segment()
&& shapeItem->track() == fullMeasureRest->track())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure that the Fermata can be safely removed from this Shape in any cases, without these checks? Cause the main purpose of this function is to check for collisions between the full measure rest and note/rests in other voices, while the Fermata position is checked elsewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. After rechecking the overall flow of this function, I understand that it is intended to handle cases with multiple voices, where a full-measure rest needs to be moved away from elements in other voices. Fermatas should not participate in this collision shape at all.
I simplified the condition accordingly.

@davidstephengrant davidstephengrant self-assigned this Jun 12, 2026
@pyonpyoco pyonpyoco force-pushed the whole-measure-rest-with-fermata branch from b385c2b to 2bccead Compare June 12, 2026 13:50
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.

Whole measure rest in voice 1 with fermata is incorrectly displaced when notes are entered in voice 2

5 participants