Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #253926: Key signature not displaying correctly on clef change at the start of a score #3666

Merged
merged 1 commit into from May 21, 2018

Conversation

mattmcclinch
Copy link
Contributor

See Key signature not displaying correctly on clef change at the start of a score.

This is currently not an issue in the master branch, because the master branch does not currently allow "mid-measure" clef changes on the first tick of the measure. If this was an unintended consequence of the restructuring of code involving clef changes, I can submit a patch to bring back this ability.

@mattmcclinch mattmcclinch force-pushed the 253926-keysig-clef-change branch 6 times, most recently from 9cb4449 to 107d7d3 Compare May 13, 2018 11:03
@anatoly-os
Copy link
Contributor

I like the code, but don't fully understand it. Could you please describe the logic of the for cycle?
On whether it was an intention or not completed refactoring in master, let's ask @wschweer.

@mattmcclinch
Copy link
Contributor Author

This is the logic of the for loop:

Starting with the segment before the key signature, and working backwards, check the segmentType() of each segment. If it is a Clef segment, get the clef for the track that the key signature is on. Stop when one of the following occurs.

  • A clef is found
  • There are no more segments to examine
  • The segment being examined is not on the same tick as the key signature

@anatoly-os anatoly-os merged commit bba5296 into musescore:2.3 May 21, 2018
@wschweer
Copy link
Contributor

Its a bug if "mid-measure" clef changes do not work in 3.0. In 3.0 the position of a segment must be determinable by type and tick as Undo can not use the segment prev/next pointers to insert the segment at the right position anymore. Fo this clefs use two different segment types: one for the system clef and another for "mid-measure" clefs to allow both at the same tick position.

@mattmcclinch mattmcclinch deleted the 253926-keysig-clef-change branch September 5, 2018 13:25
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.

None yet

3 participants