diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-08-06 21:40:01 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-09-28 11:01:43 +0000 |
commit | 9e2f4e112776149be550dbea6003a192cd931538 (patch) | |
tree | 5c9b9ba8709edb24139179c1a37784a9f693b39c /src/quick/items/qquickspriteengine.cpp | |
parent | 3eb9ee34c06d54ea21fedd3188c60e536a487b1c (diff) |
Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtDeclarative.
Change-Id: Ie6eb4d96b4d49fbed1e8be514d03e331549cd712
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/quick/items/qquickspriteengine.cpp')
-rw-r--r-- | src/quick/items/qquickspriteengine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index f20d8bc6c8..e35c766ab6 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -454,12 +454,12 @@ QImage QQuickSpriteEngine::assembledImage(int maxSize) QImage img(state->m_pix.image()); const int frameWidth = state->m_frameWidth; const int frameHeight = state->m_frameHeight; - const int imgHeight = img.height() / img.devicePixelRatioF(); - const int imgWidth = img.width() / img.devicePixelRatioF(); + const int imgHeight = img.height() / img.devicePixelRatio(); + const int imgWidth = img.width() / img.devicePixelRatio(); if (imgHeight == frameHeight && imgWidth < maxSize){ //Simple case p.drawImage(QRect(0, y, state->m_frames * frameWidth, frameHeight), img, - QRect(state->m_frameX * img.devicePixelRatioF(), 0, state->m_frames * frameWidth * img.devicePixelRatioF(), frameHeight * img.devicePixelRatioF())); + QRect(state->m_frameX * img.devicePixelRatio(), 0, state->m_frames * frameWidth * img.devicePixelRatio(), frameHeight * img.devicePixelRatio())); state->m_rowStartX = 0; state->m_rowY = y; y += frameHeight; @@ -476,7 +476,7 @@ QImage QQuickSpriteEngine::assembledImage(int maxSize) framesLeft -= copied/frameWidth; p.drawImage(QRect(x, y, copied, frameHeight), img, - QRect(curX * img.devicePixelRatioF(), curY * img.devicePixelRatioF(), copied * img.devicePixelRatioF(), frameHeight * img.devicePixelRatioF())); + QRect(curX * img.devicePixelRatio(), curY * img.devicePixelRatio(), copied * img.devicePixelRatio(), frameHeight * img.devicePixelRatio())); y += frameHeight; curX += copied; x = 0; @@ -489,7 +489,7 @@ QImage QQuickSpriteEngine::assembledImage(int maxSize) framesLeft -= copied/frameWidth; p.drawImage(QRect(x, y, copied, frameHeight), img, - QRect(curX * img.devicePixelRatioF(), curY * img.devicePixelRatioF(), copied * img.devicePixelRatioF(), frameHeight * img.devicePixelRatioF())); + QRect(curX * img.devicePixelRatio(), curY * img.devicePixelRatio(), copied * img.devicePixelRatio(), frameHeight * img.devicePixelRatio())); curY += frameHeight; x += copied; curX = 0; |