Skip to content

Clear the barline drag offset on release - #34820

Open
davidstephengrant wants to merge 1 commit into
musescore:mainfrom
davidstephengrant:dsg-clear-barline-drag-offset-on-release
Open

Clear the barline drag offset on release#34820
davidstephengrant wants to merge 1 commit into
musescore:mainfrom
davidstephengrant:dsg-clear-barline-drag-offset-on-release

Conversation

@davidstephengrant

Copy link
Copy Markdown
Contributor

Resolves: #34819

AI generated fix; please review critically.

Barlines now snap to their expected position when the grab handle is released, avoiding partial segments continuing to draw while the barline remains selected.

Screen.Recording.2026-09-05.at.10.57.09.mov

endDragGrip adds the drag offset into the layout data in order to work
out which staff the barline now ends on, but never takes it back out, so
y2 goes on describing the dragged position rather than the one about to
be laid out. y1 is offset there too, though nothing in the function
reads it.

The barline therefore keeps drawing at the dragged length until
something forces a layout, which is why one dragged less than half of
the way towards the staff below carries on drawing a partial segment
between the staves while it stays selected, and only snaps into place on
deselecting it.

Read the offset from the edit data instead and leave the layout data
alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 5, 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: Team

Run ID: e6b32ab1-4ed3-4d2c-997d-649a1ef50c95

📥 Commits

Reviewing files that changed from the base of the PR and between 7991526 and 56984ba.

📒 Files selected for processing (1)
  • src/engraving/dom/barline.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

BarLine::endDragGrip no longer writes accumulated grip offsets into layout data. It computes the bottom coordinate for span snapping from the page position, stored layout coordinate, and bottom grip offset.

Merge Risk: ⚪ Minimal · up to 56984

Releasing a dragged barline now snaps its span using the final transient grip position without retaining a partial rendered segment. The focused change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description identifies issue #34819 and explains the UX fix, but it omits the required repository checklist. Add the complete checklist from the repository template and mark each item accurately. Keep the issue reference and concise change description.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: clearing the barline drag offset when the handle is released.
Linked Issues check ✅ Passed The targeted change supports issue #34819 by keeping the drag offset out of stored layout data while still using it for span snapping, which addresses the partial barline segment after release.
Out of Scope Changes check ✅ Passed The pull request changes only the barline release and span-snapping calculation. No unrelated changes are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

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.

@avvvvve
avvvvve requested a review from miiizen September 8, 2026 13:49
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.

Partial barline continues to draw while selected when grab handle is released between staves

2 participants