Skip to content

Commit

Permalink
Merge pull request #26809 from cbjeukendrup/navigator_page_numbers_cl…
Browse files Browse the repository at this point in the history
…ipped

Fix drawing page numbers in navigator
  • Loading branch information
cbjeukendrup authored Feb 28, 2025
2 parents bdbd4c6 + ad78469 commit c21c72e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/notation/view/notationnavigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void NotationNavigator::mousePressEvent(QMouseEvent* event)
double dx = logicPos.x() - (m_cursorRect.x() + (m_cursorRect.width() / 2));
double dy = logicPos.y() - (m_cursorRect.y() + (m_cursorRect.height() / 2));

moveNotationRequested(-dx, -dy);
emit moveNotationRequested(-dx, -dy);
}

void NotationNavigator::mouseMoveEvent(QMouseEvent* event)
Expand All @@ -143,7 +143,7 @@ void NotationNavigator::mouseMoveEvent(QMouseEvent* event)

PointF logicPos = toLogical(event->pos());
PointF delta = logicPos - m_startMove;
moveNotationRequested(-delta.x(), -delta.y());
emit moveNotationRequested(-delta.x(), -delta.y());

m_startMove = logicPos;
}
Expand Down Expand Up @@ -283,13 +283,13 @@ void NotationNavigator::paintPageNumbers(QPainter* painter)
constexpr int PAGE_NUMBER_FONT_SIZE = 2000;
QFont font(QString::fromStdString(configuration()->fontFamily()), PAGE_NUMBER_FONT_SIZE);

painter->setClipping(false);
painter->setFont(font);
painter->setPen(engravingConfiguration()->scoreGreyColor().toQColor());

for (const Page* page : pages()) {
painter->translate(page->pos().toQPointF());

painter->setFont(font);
painter->setPen(engravingConfiguration()->scoreGreyColor().toQColor());
painter->drawText(page->ldata()->bbox().toQRectF(), Qt::AlignCenter, QString("%1").arg(page->no() + 1));

painter->translate(-page->pos().toQPointF());
}
}

0 comments on commit c21c72e

Please sign in to comment.