Skip to content

Commit

Permalink
Fix image pixelated when DPR is not an integer (#73)
Browse files Browse the repository at this point in the history
use devicePixelRatioF() instead of devicePixelRatio()
  • Loading branch information
kegechen authored May 20, 2024
1 parent e2bb171 commit 9580942
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layout/keyboardlayoutwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,8 @@ void KeyboardLayoutWidget::generatePixmap(bool force) {
if (w == image.width() && h == image.height() && !force)
return;

image = QPixmap(QSize(w, h) * devicePixelRatio());
image.setDevicePixelRatio(devicePixelRatio());
image = QPixmap(QSize(w, h) * devicePixelRatioF());
image.setDevicePixelRatio(devicePixelRatioF());
image.fill(Qt::transparent);
QPainter painter(&image);
painter.setRenderHint(QPainter::Antialiasing, true);
Expand Down

0 comments on commit 9580942

Please sign in to comment.