diff --git a/src/engraving/dom/cmd.cpp b/src/engraving/dom/cmd.cpp index 76c51ead13803..0af025c6d9fdd 100644 --- a/src/engraving/dom/cmd.cpp +++ b/src/engraving/dom/cmd.cpp @@ -612,7 +612,11 @@ void Score::cmdAddSpanner(Spanner* spanner, staff_idx_t staffIdx, Segment* start for (auto ss : spanner->spannerSegments()) { ss->setTrack(track); } - spanner->setTick(startSegment->tick()); + + bool isMeasureAnchor = spanner->anchor() == Spanner::Anchor::MEASURE; + Fraction tick1 = isMeasureAnchor ? startSegment->measure()->tick() : startSegment->tick(); + spanner->setTick(tick1); + Fraction tick2; if (!endSegment) { tick2 = lastSegment()->tick(); @@ -621,6 +625,13 @@ void Score::cmdAddSpanner(Spanner* spanner, staff_idx_t staffIdx, Segment* start } else { tick2 = endSegment->tick(); } + if (isMeasureAnchor) { + Measure* endMeasure = tick2measureMM(tick2); + if (endMeasure->tick() != tick2) { + tick2 = endMeasure->endTick(); + } + } + spanner->setTick2(tick2); undoAddElement(spanner, true, ctrlModifier); } diff --git a/src/engraving/dom/edit.cpp b/src/engraving/dom/edit.cpp index a37ff98bad40d..74bed208f14b1 100644 --- a/src/engraving/dom/edit.cpp +++ b/src/engraving/dom/edit.cpp @@ -6743,7 +6743,9 @@ void Score::undoInsertTime(const Fraction& tick, const Fraction& len) } for (Spanner* s : sl) { if (len > Fraction(0, 1)) { - if (tick > s->tick() && tick < s->tick2()) { + if (tick == s->tick() && s->isVolta()) { + s->undoChangeProperty(Pid::SPANNER_TICKS, s->ticks() + len); + } else if (tick > s->tick() && tick < s->tick2()) { // // case a: // +----spanner--------+