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 cbd0a32
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 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,6 +102,7 @@ void Paint::paintScore(draw::Painter* painter, Score* score, const IScoreRendere
}

drawRect = opt.frameRect;
clipRect = opt.frameRect.translated(-pagePos).intersect(clipRect);
} else {
drawRect = pageAbsRect;
}
Expand Down Expand Up @@ -129,21 +131,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 Down

0 comments on commit cbd0a32

Please sign in to comment.