Skip to content

Commit

Permalink
Merge pull request #26649 from miiizen/26632-ystem-line-crash
Browse files Browse the repository at this point in the history
Prevent crash on system line with segment as start/end element
  • Loading branch information
mike-spa authored Feb 21, 2025
2 parents 11af715 + 407fc1c commit 074245e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/engraving/dom/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,9 @@ void Selection::updateSelectedElements()
if ((sp->tick() >= stick && sp->tick() < etick) || (sp->tick2() >= stick && sp->tick2() <= etick)) {
EngravingItem* startCR = sp->startCR();
EngravingItem* endCR = sp->endCR();
const bool canSelectStart = (sp->startElement()->isTimeTickAnchor() || canSelect(startCR));
const bool canSelectEnd = (sp->endElement()->isTimeTickAnchor() || canSelect(endCR));
const bool canSelectStart
= (sp->startElement()->isTimeTickAnchor() || sp->startElement()->isSegment() || canSelect(startCR));
const bool canSelectEnd = (sp->endElement()->isTimeTickAnchor() || sp->endElement()->isSegment() || canSelect(endCR));
if (canSelectStart && canSelectEnd) {
for (auto seg : sp->spannerSegments()) {
appendFiltered(seg); // spanner with start or end in range selection
Expand Down

0 comments on commit 074245e

Please sign in to comment.