Skip to content

Commit

Permalink
Fix musescore#7819 - adjustment to previous page-clipping fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wizofaus committed Apr 2, 2024
1 parent a4b505c commit b3429c3
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/engraving/rendering/dev/paint.cpp
Expand Up @@ -90,6 +90,7 @@ void Paint::paintScore(draw::Painter* painter, Score* score, const IScoreRendere

//! NOTE Check draw rect, usually for optimisation drawing on screen (draw only what we see)
RectF drawRect;
RectF clipRect = pageRect;
RectF pageAbsRect = pageRect.translated(pagePos);
if (opt.frameRect.isValid()) {
if (pageAbsRect.right() < opt.frameRect.left()) {
Expand All @@ -101,7 +102,9 @@ void Paint::paintScore(draw::Painter* painter, Score* score, const IScoreRendere
}

drawRect = opt.frameRect;
} else {
clipRect = opt.frameRect.translated(-pagePos).intersect(clipRect);
}
else {
drawRect = pageAbsRect;
}

Expand Down Expand Up @@ -129,21 +132,14 @@ void Paint::paintScore(draw::Painter* painter, Score* score, const IScoreRendere
}

// Draw page elements
bool disableClipping = false;

if (!painter->hasClipping()) {
painter->setClipping(true);
painter->setClipRect(pageRect);
disableClipping = true;
}
painter->setClipping(true);
painter->setClipRect(clipRect);

std::vector<EngravingItem*> elements = page->items(drawRect.translated(-pagePos));
paintItems(*painter, elements);
//DebugPaint::paintPageTree(*painter, page);

if (disableClipping) {
painter->setClipping(false);
}
painter->setClipping(false);

if (!opt.isPrinting) {
DebugPaint::paintPageDebug(*painter, page, elements);
Expand All @@ -153,7 +149,8 @@ void Paint::paintScore(draw::Painter* painter, Score* score, const IScoreRendere

if (opt.isMultiPage) {
painter->translate(-pagePos);
} else if (opt.trimMarginPixelSize >= 0) {
}
else if (opt.trimMarginPixelSize >= 0) {
painter->translate(pageRect.topLeft());
}

Expand Down

0 comments on commit b3429c3

Please sign in to comment.