From cd0c1607ef61ceff407ef09eb8777b197427ae1a Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Tue, 27 May 2025 18:07:19 +0100 Subject: [PATCH] GameList: Clip flag and compatibility pixmaps to the available space --- pcsx2-qt/GameList/GameListWidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index d338e9c71e..74adbe0a24 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -128,6 +128,10 @@ namespace const int pix_width = static_cast(pix.width() / pix.devicePixelRatio()); const int pix_height = static_cast(pix.height() / pix.devicePixelRatio()); + // Clip the pixmaps so they don't extend outside the column + painter->save(); + painter->setClipRect(option.rect); + // Draw the icon, using code derived from QItemDelegate::drawDecoration() const bool enabled = option.state & QStyle::State_Enabled; const QPoint p = QPoint((r.width() - pix_width) / 2, (r.height() - pix_height) / 2); @@ -159,6 +163,9 @@ namespace { painter->drawPixmap(r.topLeft() + p, pix); } + + // Restore the old clip path. + painter->restore(); } }; } // namespace