Use Qt's High-DPI scaling on Windows (#4868)
This commit is contained in:
+3
-16
@@ -88,23 +88,10 @@ void Label::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
||||
qreal deviceDpi =
|
||||
#ifdef Q_OS_WIN
|
||||
this->devicePixelRatioF();
|
||||
#else
|
||||
1.0;
|
||||
#endif
|
||||
|
||||
QFontMetrics metrics = getIApp()->getFonts()->getFontMetrics(
|
||||
this->getFontStyle(),
|
||||
this->scale() * 96.f /
|
||||
std::max<float>(
|
||||
0.01F, static_cast<float>(this->logicalDpiX() * deviceDpi)));
|
||||
painter.setFont(getIApp()->getFonts()->getFont(
|
||||
this->getFontStyle(),
|
||||
this->scale() * 96.f /
|
||||
std::max<float>(
|
||||
0.02F, static_cast<float>(this->logicalDpiX() * deviceDpi))));
|
||||
this->getFontStyle(), this->scale());
|
||||
painter.setFont(
|
||||
getIApp()->getFonts()->getFont(this->getFontStyle(), this->scale()));
|
||||
|
||||
int offset = this->getOffset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user