diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-03-22 18:12:58 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-23 03:45:21 +0100 |
commit | c913351c9d6e3181cdddcc851e9d80cd7689fe93 (patch) | |
tree | 55d707f40da8227c3ddc74248b1d7360c755f259 /src/quick/items/qquickspriteengine.cpp | |
parent | ddff2017c81df838aac0ad19b6a3accd36254a7d (diff) |
Fix Sprite Assembly
This optimization doesn't account for the width of the assembled image
possibly being too small to fit the whole source image width. Since it
meant copying more image data than we needed, I'm no longer convinced
that it actually is an optimization over a simple cut (as this patch
implements).
Change-Id: I3fe502a75979e972f62d9dbf26f1ffec9069a102
Reviewed-by: Yann Bodson <yann.bodson@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 1c35688c29..d4ddbc400d 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -411,9 +411,9 @@ QImage QQuickSpriteEngine::assembledImage() int frameWidth = state->m_frameWidth; int frameHeight = state->m_frameHeight; if (img.height() == frameHeight && img.width() < maxSize){//Simple case - p.drawImage(0,y,img); + p.drawImage(0,y,img.copy(state->m_frameX,0,state->m_frames * frameWidth, frameHeight)); + state->m_rowStartX = 0; state->m_rowY = y; - state->m_rowStartX = state->m_frameX;//In case it was offset, but we took the simple route of not chopping out the other bits y += frameHeight; }else{//Chopping up image case state->m_framesPerRow = image.width()/frameWidth; |