Permalink
Browse files

Merge pull request #6916 from spycrab/qt_indicator_aa

Qt/MappingIndicator: Improve render quality
  • Loading branch information...
spycrab committed May 20, 2018
2 parents 4284952 + b4f1c48 commit f7323a4419f60f103d805722cefb0e1b4f0fa8cf
Showing with 11 additions and 4 deletions.
  1. +11 −4 Source/Core/DolphinQt2/Config/Mapping/MappingIndicator.cpp
@@ -109,6 +109,8 @@ void MappingIndicator::DrawCursor(bool tilt)
float centerx = width() / 2., centery = height() / 2.;
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::SmoothPixmapTransform, true);
float width = 64, height = 64;
float deadzone = m_cursor_deadzone->GetValue() * 48;
@@ -194,6 +196,8 @@ void MappingIndicator::DrawStick()
}};
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::SmoothPixmapTransform, true);
// Draw maximum values
p.setBrush(Qt::white);
@@ -222,6 +226,9 @@ void MappingIndicator::DrawStick()
void MappingIndicator::DrawMixedTriggers()
{
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::TextAntialiasing, true);
p.setRenderHint(QPainter::SmoothPixmapTransform, true);
// Polled values
double r_analog = PollControlState(m_mixed_triggers_r_analog);
@@ -257,10 +264,10 @@ void MappingIndicator::DrawMixedTriggers()
p.setBrush(Qt::black);
p.setPen(Qt::white);
p.drawText(width() * 0.225, 16, tr("L-Analog"));
p.drawText(width() * 0.8 + 16, 16, tr("L"));
p.drawText(width() * 0.225, 48, tr("R-Analog"));
p.drawText(width() * 0.8 + 16, 48, tr("R"));
p.drawText(width() * 0.225, 20, tr("L-Analog"));
p.drawText(width() * 0.8 + 16, 20, tr("L"));
p.drawText(width() * 0.225, 52, tr("R-Analog"));
p.drawText(width() * 0.8 + 16, 52, tr("R"));
}
void MappingIndicator::paintEvent(QPaintEvent*)

0 comments on commit f7323a4

Please sign in to comment.