Skip to content

Commit

Permalink
Fix canvas pixmap being too big when using devicePixelRatio > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Sep 24, 2023
1 parent e79a399 commit a9dd203
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core_lib/src/interface/scribblearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,12 @@ void ScribbleArea::paintEvent(QPaintEvent* event)

// paints the canvas
painter.setWorldMatrixEnabled(false);
painter.drawPixmap(event->rect(), mCanvas, event->rect());

// In other places we use the blitRect to paint the buffer pixmap, however
// the main pixmap which needs to be scaled accordingly to DPI, which is not accounted for when using the event rect
// instead we can set a clipRect to avoid the area being updated needlessly
painter.setClipRect(event->rect());
painter.drawPixmap(QPointF(), mCanvas);

currentTool()->paint(painter);

Expand Down

0 comments on commit a9dd203

Please sign in to comment.