Skip to content

Conversation

@mathesoncalum
Copy link
Contributor

@mathesoncalum mathesoncalum commented Nov 12, 2025

Resolves: #30959

See comment - data.track is a nidx in this case so SysStaff evaluates to null

@XiaoMigros
Copy link
Contributor

Why are tremolos able to call Measure::acceptDrop in the first place? They should be caught by the earlier code (Note::acceptDrop and Chord::drop). Either way, EditData::track should be set before being able to reach acceptDrop, which is where I think a fix should investigate. The reason for switching to a stored track as opposed to a position is twofold: On the one hand, it saves calls to pos2measure, but more importantly, it stops dropping/pasting to invisible staves from behaving unpredictably.

@mathesoncalum
Copy link
Contributor Author

OK thanks for the clarification - I think that makes sense!

@mathesoncalum
Copy link
Contributor Author

To answer your question about calling acceptDrop with a tremolo - take a look at prepareDropStandardElement and how we populate the "droppable tree". We do this once every time we start a new drag from the palette - we go through all elements on the page and collect those that accept a drop for the given item. Critically we don't just scan through notes/chords, so it is possible that we can end up querying a measure (in which case we should just return false).

@XiaoMigros
Copy link
Contributor

Since 10eadab, maybe that tree iteration can be improved upon, as any notes or rests in a measure will call Measure::acceptDrop automatically.

@mathesoncalum mathesoncalum force-pushed the 30959-crash_drag_tremolo branch from 0a133c7 to 7273b80 Compare November 17, 2025 12:14
@mathesoncalum
Copy link
Contributor Author

Ok, I'm just going to fix the crash in this PR but you raise an interesting point about that optimisation @XiaoMigros. I've stuck that on my todo list.

Thanks for your help on this one!

@zacjansheski
Copy link
Contributor

Tested on MacOS 15, Windows 11, Ubuntu 22.04.3. Approved
#30959 FIXED

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.

Nightly 4.7 - Crash dragging tremolo to note

4 participants