Skip to content

Commit be007fa

Browse files
committed
Fix inc/dec duration command when used with dotted notes
Resolves: #28069 The inc/dec duration command used the input state duration as the initial duration instead of the duration of the selected note. This started causing issues because the input state duration is changed on each selection change in NotationNoteInput::updateInputState() when the "Apply accidentals, [...]" setting is set to "To previous not entered".
1 parent cb26698 commit be007fa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/engraving/dom/cmd.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,18 +3295,17 @@ void Score::cmdIncDecDuration(int nSteps, bool stepDotted)
32953295
ChordRest* cr = toChordRest(el);
32963296

32973297
// if measure rest is selected as input, then the correct initialDuration will be the
3298-
// duration of the measure's time signature, else is just the input state's duration
3299-
TDuration initialDuration;
3300-
if (cr->durationType() == DurationType::V_MEASURE) {
3298+
// duration of the measure's time signature, else is just the ChordRest's duration
3299+
TDuration initialDuration = cr->durationType();
3300+
if (initialDuration == DurationType::V_MEASURE) {
33013301
initialDuration = TDuration(cr->measure()->timesig(), true);
33023302

33033303
if (initialDuration.fraction() < cr->measure()->timesig() && nSteps > 0) {
33043304
// Duration already shortened by truncation; shorten one step less
33053305
--nSteps;
33063306
}
3307-
} else {
3308-
initialDuration = m_is.duration();
33093307
}
3308+
33103309
TDuration d = (nSteps != 0) ? initialDuration.shiftRetainDots(nSteps, stepDotted) : initialDuration;
33113310
if (!d.isValid()) {
33123311
return;

0 commit comments

Comments
 (0)