Skip to content
Snippets Groups Projects
Unverified Commit 9c4148cc authored by Nicolas Werner's avatar Nicolas Werner Committed by GitHub
Browse files

Merge pull request #314 from MayeulC/smoothie-2

Smooth all the things [v2]
parents 27bf654d 5f086cd9
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ Rectangle {
asynchronous: true
fillMode: Image.PreserveAspectCrop
mipmap: true
smooth: false
smooth: true
sourceSize.width: avatar.width
sourceSize.height: avatar.height
layer.enabled: true
......
......@@ -29,6 +29,8 @@ Item {
source: model.data.url.replace("mxc://", "image://MxcImage/")
asynchronous: true
fillMode: Image.PreserveAspectFit
smooth: true
mipmap: true
MouseArea {
id: mouseArea
......
......@@ -121,7 +121,9 @@ Avatar::paintEvent(QPaintEvent *)
bool rounded = QSettings().value("user/avatar_circles", true).toBool();
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform |
QPainter::TextAntialiasing);
QRectF r = rect();
const int hs = size_ / 2;
......
......@@ -139,18 +139,10 @@ public:
PainterHighQualityEnabler(Painter &p)
: _painter(p)
{
static constexpr QPainter::RenderHint Hints[] = {QPainter::Antialiasing,
QPainter::SmoothPixmapTransform,
QPainter::TextAntialiasing};
auto hints = _painter.renderHints();
for (const auto &hint : Hints) {
if (!(hints & hint))
hints_ |= hint;
}
hints_ = QPainter::Antialiasing | QPainter::SmoothPixmapTransform |
QPainter::TextAntialiasing;
if (hints_)
_painter.setRenderHints(hints_);
_painter.setRenderHints(hints_);
}
~PainterHighQualityEnabler()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment