Skip to content

Commit

Permalink
fix search page function, make navigator aware of page offset
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Apr 4, 2014
1 parent a152de6 commit 61409b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mscore/navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void Navigator::paintEvent(QPaintEvent* ev)
if (page->score()->layoutMode() == LayoutPage) {
p.setFont(QFont("FreeSans", 400)); // !!
p.setPen(MScore::layoutBreakColor);
p.drawText(page->bbox(), Qt::AlignCenter, QString("%1").arg(page->no()+1));
p.drawText(page->bbox(), Qt::AlignCenter, QString("%1").arg(page->no() + 1 + _score->pageNumberOffset()));
}
p.translate(-pos);
}
Expand Down
4 changes: 4 additions & 0 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5248,6 +5248,10 @@ void ScoreView::search(const QString& s)

void ScoreView::searchPage(int n)
{
n -= score()->pageNumberOffset();
if (n <= 0)
n = 1;
n--;
if (n >= _score->npages())
n = _score->npages() - 1;
const Page* page = _score->pages()[n];
Expand Down

0 comments on commit 61409b1

Please sign in to comment.