Skip to content

Limit leading space and line thicknesses - #34449

Open
sundialrise wants to merge 3 commits into
musescore:mainfrom
sundialrise:leadingspace
Open

Limit leading space and line thicknesses#34449
sundialrise wants to merge 3 commits into
musescore:mainfrom
sundialrise:leadingspace

Conversation

@sundialrise

@sundialrise sundialrise commented Aug 3, 2026

Copy link
Copy Markdown

Makes some progress on #25799

This PR adds a check to HorizontalSpacing::spaceSegments so that segments cannot be moved to the left off the page using a negative leading space. It also lowers the maximums on beam and staff line thicknesses (down to the thickness where the lines would overlap), as well as barline thickness.

  • I signed the CLA as sundialrise
  • 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. (Set limits to spin boxes values #25799 lists multiple problems, so this PR does not resolve it in the sense of closing it.)
  • 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). (Is this change large enough to need a unit test?)

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds page-aware clamping for segment positions after leading space is applied. It limits beam thickness to 1. It adds maximum values for staff line width and three barline width controls.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: limiting leading space and line thicknesses.
Description check ✅ Passed The description explains the changes and completes nearly all checklist items; the optional test item is explicitly addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were 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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/engraving/rendering/score/horizontalspacing.cpp`:
- Around line 294-297: Update the clamping block around
placedSegments.back().xPosInSystemCoords so ctx.xCur is synchronized with the
final clamped segment position before the segment width is added, ensuring
subsequent spacing uses the corrected horizontal coordinate.

In `@src/notationscene/widgets/editstyle.ui`:
- Around line 462-464: Update the style-edit dialog’s load/save handling for the
QDoubleSpinBox fields at the referenced properties, including staffLineWidth,
barWidth, doubleBarWidth, and endBarWidth. Ensure legacy values above their
declared maxima are not silently clamped by setValue() and overwritten on save;
preserve those values or apply an explicit migration before persistence. Keep
normal in-range UI behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 30ba3d60-06d1-4347-9755-e2bc1ef0e197

📥 Commits

Reviewing files that changed from the base of the PR and between 4822c0f and a712044.

📒 Files selected for processing (3)
  • src/engraving/rendering/score/horizontalspacing.cpp
  • src/notationscene/qml/MuseScore/NotationScene/styledialog/BeamsPage.qml
  • src/notationscene/widgets/editstyle.ui

Comment thread src/engraving/rendering/score/horizontalspacing.cpp
Comment thread src/notationscene/widgets/editstyle.ui
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.

2 participants