Skip to content

Commit

Permalink
hidpi: fix splash screen scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jan 22, 2025
1 parent 7f679f8 commit 96bbff4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/StartScreen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ void InteractiveLabel::paintEvent(QPaintEvent* event)

painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);
painter.setRenderHint(QPainter::RenderHint::SmoothPixmapTransform);
painter.setPen(QPen{m_currentColor});

painter.save();
Expand Down Expand Up @@ -326,7 +327,7 @@ StartScreen::StartScreen(const QPointer<QRecentFilesMenu>& recentFiles, QWidget*
}

// Weird code here is because the window size seems to scale only to integer ratios.
setFixedSize(m_background.size() / std::floor(qApp->devicePixelRatio()));
setFixedSize(m_background.size() / m_background.devicePixelRatioF());

{
// new version
Expand Down Expand Up @@ -489,6 +490,7 @@ void StartScreen::addLoadCrashedSession()
void StartScreen::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
painter.setRenderHint(QPainter::RenderHint::SmoothPixmapTransform);
painter.drawPixmap(0, 0, m_background);
}

Expand Down

0 comments on commit 96bbff4

Please sign in to comment.