Skip to content

Commit

Permalink
fix #280442: fix a crash on hiding all staves if there are system ele…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
dmitrio95 committed Dec 22, 2018
1 parent fb71526 commit a5a1946
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libmscore/element.cpp
Expand Up @@ -2139,7 +2139,13 @@ void Element::autoplaceSegmentElement(qreal minDistance)
if (visible() && autoplace() && parent()) {
Segment* s = toSegment(parent());
Measure* m = s->measure();
int si = systemFlag() ? m->system()->firstVisibleStaff() : staffIdx();

int si = staffIdx();
if (systemFlag()) {
const int firstVis = m->system()->firstVisibleStaff();
if (firstVis < score()->nstaves())
si = firstVis;
}

SysStaff* ss = m->system()->staff(si);
QRectF r = bbox().translated(m->pos() + s->pos() + pos());
Expand Down

0 comments on commit a5a1946

Please sign in to comment.