-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix #24922, 26612, 29611: Refactor key signatures #29610
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
Conversation
cc3845f to
4622c48
Compare
54fd3eb to
dc002e4
Compare
611b124 to
8c14f71
Compare
12d2ecc to
bce2006
Compare
67916a7 to
0e2bcf3
Compare
mike-spa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@XiaoMigros left a few comments. Please also rebase if possible
src/engraving/dom/keysig.cpp
Outdated
| if (staff() && segment()) { | ||
| const Fraction changeTick = staff()->currentKeyTick(tick()); | ||
| if (Segment* s = score()->tick2segment(changeTick, true, SegmentType::KeySig)) { | ||
| return toKeySig(s->element(staff2track(staffIdx()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right to me, or I'm not understanding it. It looks like you're delegating the properties of this key signature to the "initial" key signature that established the current key... why? Pid::IS_COURTESY looks especially strange, cause being a courtesy is certainly a property of the individual key sig, not a general one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The principal reason for this is that when switching from a non-C key to C, you can't modify Pid::IS_COURTESY (or any other property) of the new C key because only the generated courtesy key signature on the previous system has a clickable hitbox.
I also found allowing property delegation for key signatures also solves some other minor bugs (such as the properties window still showing clickable options for generated keysigs, but not doing anything), but I'll admit I'm not particularly happy with this solution (especially since we have to go looking for the initial key signature in this fashion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it thanks. Then if this delegation is meant to only apply from the courtesy onto the corresponding "main" signature, I'd suggest to be more explicit about it, for instance:
- check if the current keySig is a courtesy (if it isn't, no need to delegate)
- if you're on a courtesy keySig segment, you'll find the corresponding main keySig just a few segments ahead, you can probably do with a single
s->next1(SegmentType::KEY_SIG)call, no need to usetick2Segmentwhich is quite expensive
833dc04 to
2ab883d
Compare
mike-spa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final couple of comments
2ab883d to
a1438bb
Compare
|
SEGV in the VTests, not sure if that's due to the property delegation changes or the rebase. Will investigate... |
a1438bb to
dc36a1d
Compare
|
@XiaoMigros I've pushed the crash fix directly to your branch to speed things up. I'm now going to add some quick UI elements that we've agreed with our design team to expose your new option for naturals, then we'll merge :) |
|
Thank you :)) |
3a4d22f to
4711bf6
Compare
4711bf6 to
ef7dc60
Compare
|
Looks good from my end! Approved. |
Resolves: #24922
Resolves: #26612
Resolves: #29611