mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
qt: avoid explicit QPainter calls in RoundImage
This commit is contained in:
parent
9cbeacfcf7
commit
38c2a7ecbf
@ -351,17 +351,17 @@ QImage RoundImage::RoundImageGenerator::execute()
|
|||||||
|
|
||||||
target.fill(Qt::transparent);
|
target.fill(Qt::transparent);
|
||||||
|
|
||||||
QPainter painter;
|
{
|
||||||
painter.begin(&target);
|
QPainter painter(&target);
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addRoundedRect(0, 0, width, height, radius, radius);
|
path.addRoundedRect(0, 0, width, height, radius, radius);
|
||||||
painter.setClipPath(path);
|
painter.setClipPath(path);
|
||||||
|
|
||||||
painter.drawImage({alignedCenteredTopLeft, targetSize}, sourceReader.read());
|
painter.drawImage({alignedCenteredTopLeft, targetSize}, sourceReader.read());
|
||||||
painter.end();
|
}
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user