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 #272403: Corruption on pasting a range with a truncated note that requires a tie #3688
fix #272403: Corruption on pasting a range with a truncated note that requires a tie #3688
Conversation
libmscore/paste.cpp
Outdated
@@ -482,7 +483,7 @@ void Score::pasteChordRest(ChordRest* cr, int tick, const Interval& srcTranspose | |||
// we have already disallowed a tuplet from crossing the barline, so there is no problem here | |||
// but due to rounding, it might appear from actualTicks() that the last note is too long by a couple of ticks | |||
|
|||
if (!isGrace && !cr->tuplet() && (tick + cr->actualTicks() > measureEnd || convertMeasureRest)) { | |||
if (!isGrace && !cr->tuplet() && (tick + cr->actualTicks() > measureEnd || cr->durationTypeTicks() != cr->actualTicks() || convertMeasureRest)) { |
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.
It is good to have additional parenthesizes not to remember the operations sequence. If something like || vs && vs == is clear, but + in this sequence makes things worse. Could you please add the parenthesizes?
fcf88b6
to
6946a74
Compare
I modified copypaste17-ref.mscx and copypaste20-ref.mscx so mtest now expects the new results and the tests pass. |
@mattmcclinch could you please rebase the commits onto master? This PR looks good. |
@mattmcclinch could you please rebase the PR so it could be merged to master? |
6946a74
to
ab6830f
Compare
I must have missed you asking me earlier. Or I might have been trying to focus on something else at the time. Either way, I have rebased the PR now. |
See 272403: Corruption on pasting a range with a truncated note that requires a tie.
Score::pasteStaff()
will shorten a ChordRest if necessary to make it fit into the gap created for it. This may result in a duration which is not achievable without ties (or multiple rests). The ChordRest is then assigned a duration type which may or may not match its actual duration.Score::pasteChordRest()
can then check for this mismatch, and it is already able to do what needs to be done.The example given in the bug report uses a compound meter.
toRhythmicDurationList()
does a better job of choosing appropriateTDuration
s for the individual ChordRests thantoDurationList()
in the case of a compound meter, and it handles simple meters just as well. The second argument totoRhythmicDurationList()
has nothing to do with the second argument totoDurationList()
. They just both happen to be of typebool
.