Skip to content

Commit

Permalink
Merge pull request #24785 from alexpavlov96/gp_bend_crash
Browse files Browse the repository at this point in the history
fixed stretched bend crash
  • Loading branch information
alexpavlov96 committed Sep 18, 2024
2 parents a2a34dc + 4871b44 commit 1f711ac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/engraving/dom/stretchedbend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ void StretchedBend::fillStretchedSegments(bool untilNextSegment)
}
}

if (!untilNextSegment) {
return;
}

/// adjust coordinate to bend of tied back note
StretchedBend* backTiedBend = backTiedStretchedBend();
if (backTiedBend) {
Expand All @@ -474,6 +478,11 @@ void StretchedBend::fillStretchedSegments(bool untilNextSegment)
for (EngravingItem* item : tiedBackChord->el()) {
if (item->isStretchedBend()) {
StretchedBend* bendToAdjust = toStretchedBend(item);
IF_ASSERT_FAILED(!bendToAdjust->m_bendSegmentsStretched.empty()) {
LOGE() << "wrong bend data while adjusting coordinates";
return;
}

PointF& tiedBendEndPoint = bendToAdjust->m_bendSegmentsStretched.back().dest;
tiedBendEndPoint.setX(newX);
}
Expand Down

0 comments on commit 1f711ac

Please sign in to comment.