Skip to content

Commit

Permalink
Fix 322957 and musescore#8592: fix issues discovered while moving gri…
Browse files Browse the repository at this point in the history
…p handles around on trills

Two unrelated issues, neither really to do with trill lines specifically at all but both discovered at the same time:

a) if you drag the grip handle from any line into a 0-stave system (e.g. for a V-frame, as new scores have by default at the top of the score), it crashes
b) a bug in the layout engine where it reused cached information from a previous layout caused erratic behaviour when dragging grip handles around, though it could be triggered in other ways,

Backport of musescore#8600
  • Loading branch information
wizofaus authored and Jojo-Schmitz committed Jul 27, 2021
1 parent 0643ca8 commit 3bb02e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,8 @@ System* Score::getNextSystem(LayoutContext& lc)
if (!isVBox) {
int nstaves = Score::nstaves();
system->adjustStavesNumber(nstaves);
for (int i = 0; i < nstaves; ++i)
system->staff(i)->setShow(score()->staff(i)->show());
}
return system;
}
Expand Down
2 changes: 1 addition & 1 deletion libmscore/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Segment* LineSegment::findSegmentForGrip(Grip grip, QPointF pos) const
System* sys = oldSeg->system();
const QList<System*> foundSystems = score()->searchSystem(pos, sys, spacingFactor);

if (!foundSystems.empty() && !foundSystems.contains(sys))
if (!foundSystems.empty() && !foundSystems.contains(sys) && foundSystems[0]->staves()->size())
sys = foundSystems[0];

// Restrict searching segment to the correct staff
Expand Down

0 comments on commit 3bb02e3

Please sign in to comment.