fix measure search when instrument is hidden

This commit is contained in:
lasconic 2013-08-29 18:42:01 +02:00
parent 4bb0887967
commit e8bb51967b
2 changed files with 8 additions and 8 deletions

View file

@ -806,22 +806,22 @@ MeasureBase* Page::pos2measure(const QPointF& p, int* rst, int* pitch,
int i;
for (i = 0; i < score()->nstaves();) {
SysStaff* staff = s->staff(i);
if (!staff->show()) {
SysStaff* stff = s->staff(i);
if (!stff->show() || !score()->staff(i)->show()) {
++i;
continue;
}
int ni = i;
for (;;) {
++ni;
if (ni == score()->nstaves() || s->staff(ni)->show())
if (ni == score()->nstaves() || (s->staff(ni)->show() && score()->staff(ni)->show()))
break;
}
qreal sy2;
if (ni != score()->nstaves()) {
SysStaff* nstaff = s->staff(ni);
qreal s1y2 = staff->bbox().y() + staff->bbox().height();
qreal s1y2 = stff->bbox().y() + stff->bbox().height();
sy2 = s1y2 + (nstaff->bbox().y() - s1y2)/2;
}
else

View file

@ -601,22 +601,22 @@ MeasureBase* Score::pos2measure(const QPointF& p, int* rst, int* pitch,
int i;
for (i = 0; i < nstaves();) {
SysStaff* staff = s->staff(i);
if (!staff->show()) {
SysStaff* stff = s->staff(i);
if (!stff->show() || !staff(i)->show()) {
++i;
continue;
}
int ni = i;
for (;;) {
++ni;
if (ni == nstaves() || s->staff(ni)->show())
if (ni == nstaves() || (s->staff(ni)->show() && staff(ni)->show()))
break;
}
qreal sy2;
if (ni != nstaves()) {
SysStaff* nstaff = s->staff(ni);
qreal s1y2 = staff->bbox().y() + staff->bbox().height();
qreal s1y2 = stff->bbox().y() + stff->bbox().height();
sy2 = s1y2 + (nstaff->bbox().y() - s1y2)/2;
}
else