main: Convert to device independent coordinates for scaling

devicePixelRatioF() returns the scaling ratio when high dpi scaling is enabled.
When high dpi scaling is enabled, the raw screen coordinate system is scaled to device independent coordinates.
This commit is contained in:
Morph
2023-01-25 21:16:05 -05:00
parent 5be85c556e
commit ad6cec71ec
3 changed files with 13 additions and 8 deletions

View File

@ -575,7 +575,7 @@ void QtSoftwareKeyboardDialog::MoveAndResizeWindow(QPoint pos, QSize size) {
QDialog::resize(size);
// High DPI
const float dpi_scale = qApp->screenAt(pos)->logicalDotsPerInch() / 96.0f;
const float dpi_scale = screen()->logicalDotsPerInch() / 96.0f;
RescaleKeyboardElements(size.width(), size.height(), dpi_scale);
}