-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable antialiasing for reply button #5491
Enable antialiasing for reply button #5491
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to do a sweep of any other images that could do with the same hint - but that's for another day. Looks good to me!
@@ -392,6 +392,7 @@ void ImageWithCircleBackgroundLayoutElement::paint( | |||
if (pixmap && !this->image_->animated()) | |||
{ | |||
QRectF boxRect(this->getRect()); | |||
painter.setRenderHint(QPainter::Antialiasing); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to the value it had before, after calling drawPixmap
(probably best to read it before calling setRenderHint
rather than pushing the state).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and added QPainter::save
and QPainter::restore
calls around every message layout element paint in a4daddf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First off: this works.
The main thing I'm/was concerned with is that we do a bit too much, since we don't really need to save
for every element.
Also noticed that the button is antialiased if you reply to a message (since the reply curve is antialiased).
Save/restore also affects all writes to pen, brush, etc so I added it outside since it seemed like we wanted to isolate the effects to the painter from inside each message element. But we could instead have it only wherever we use render hints, which is perhaps where it really matters. |
Description
Enables antialiasing for the reply button. This has always bugged me. I saw a screenshot of Chatterino on Twitter and was instantly compelled to fix it. Before/after: