mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-01-06 09:03:58 +00:00
Fix pixelation of small areas
This commit is contained in:
committed by
borgmanJeremy
parent
c5b6fe3957
commit
c8767e7a1b
@@ -87,10 +87,12 @@ void PixelateTool::process(QPainter& painter,
|
||||
scene.render(&painter, selection, QRectF());
|
||||
} else {
|
||||
int width = selection.width() * (0.5 / qMax(1, m_thickness));
|
||||
int height = selection.height() * (0.5 / qMax(1, m_thickness));
|
||||
QSize size = QSize(qMax(width, 1), qMax(height, 1));
|
||||
|
||||
QPixmap t = pixmap.copy(selection);
|
||||
t = t.scaledToWidth(qMax(width, 1), Qt::SmoothTransformation);
|
||||
t = t.scaledToWidth(selection.width());
|
||||
t = t.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
t = t.scaled(selection.width(), selection.height());
|
||||
painter.drawImage(selection, t.toImage());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user