diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-12-16 15:23:59 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-20 06:39:39 +0100 |
commit | 265fe7770778b85e174c39c33ecc9431d7f55b75 (patch) | |
tree | ea1d2977337c5cb039dae04e6865bea41369e5a4 /src/quick/items/qquickspriteengine.cpp | |
parent | f0c82e77aa2811c326c543468fc422c18ca98a47 (diff) |
Fix sprite chopping
Had some rounding around the wrong way.
Change-Id: I90ea339c35074ca7287c069bdbdd106578b1501b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/items/qquickspriteengine.cpp')
-rw-r--r-- | src/quick/items/qquickspriteengine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index c25ccf3487..ddd667a125 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -234,14 +234,14 @@ QImage QQuickSpriteEngine::assembledImage() struct helper{ static int divRoundUp(int a, int b){return (a+b-1)/b;} }; - int rowsNeeded = helper::divRoundUp(state->frames(), helper::divRoundUp(maxSize, state->frameWidth())); + int rowsNeeded = helper::divRoundUp(state->frames(), (maxSize / state->frameWidth())); if (rowsNeeded * state->frameHeight() > maxSize){ qWarning() << "SpriteEngine: Animation too large to fit in one texture..." << state->source().toLocalFile(); qWarning() << "SpriteEngine: Your texture max size today is " << maxSize; } state->m_generatedCount = rowsNeeded; h += state->frameHeight() * rowsNeeded; - w = qMax(w, helper::divRoundUp(maxSize, state->frameWidth())); + w = qMax(w, ((int)(maxSize / state->frameWidth())) * state->frameWidth()); m_imageStateCount += rowsNeeded; }else{ h += state->frameHeight(); |