Skip to content

Commit

Permalink
QCachedPainter: fix pixmapRect() for dpr != 1
Browse files Browse the repository at this point in the history
Return the correct (device independent) size of the pixmap rect.
This amends 75617ef.

Task-number: QTBUG-129680
Change-Id: I19ed4665143824204de77e01ae47772d79fbf0ff
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
chehrlic committed Nov 6, 2024
1 parent 0a1c171 commit cb9d822
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/widgets/styles/qstyle_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class Q_WIDGETS_EXPORT QCachedPainter
}
QRect pixmapRect() const
{
return QRect(0, 0, m_pixmap.width(), m_pixmap.height());
const auto sz = m_pixmap.deviceIndependentSize();
return QRect(0, 0, sz.width(), sz.height());
}
QPainter *operator->()
{
Expand Down

0 comments on commit cb9d822

Please sign in to comment.