Pin antialiasing option (#1997)
* adds a config option to toggle antialiasing for the pin zoom * fix C++ scope error thanks for @veracioux * set the default value of antialiasing of pin tool to be true * fix the clang-format
This commit is contained in:
committed by
GitHub
parent
988dcab9de
commit
08e532f787
@@ -121,9 +121,19 @@ void PinWidget::mouseMoveEvent(QMouseEvent* e)
|
||||
|
||||
void PinWidget::setScaledPixmap(const QSize& size)
|
||||
{
|
||||
ConfigHandler config;
|
||||
QPixmap scaledPixmap;
|
||||
|
||||
const qreal scale = qApp->devicePixelRatio();
|
||||
QPixmap scaledPixmap = m_pixmap.scaled(
|
||||
size * scale, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
||||
if (config.antialiasingPinZoom()) {
|
||||
scaledPixmap = m_pixmap.scaled(
|
||||
size * scale, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
} else {
|
||||
scaledPixmap = m_pixmap.scaled(
|
||||
size * scale, Qt::KeepAspectRatio, Qt::FastTransformation);
|
||||
}
|
||||
|
||||
scaledPixmap.setDevicePixelRatio(scale);
|
||||
m_label->setPixmap(scaledPixmap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user