diff --git a/cocos2d/core/renderer/assemblers/sprite/simple.js b/cocos2d/core/renderer/assemblers/sprite/simple.js index eb45139c5f..58bfefed86 100644 --- a/cocos2d/core/renderer/assemblers/sprite/simple.js +++ b/cocos2d/core/renderer/assemblers/sprite/simple.js @@ -55,12 +55,12 @@ module.exports = { texh = texture._height; let frame = sprite.spriteFrame; let rect = frame._rect; - let l = texw === 0 ? 0 : rect.x / texw; - let r = texw === 0 ? 0 : (rect.x + rect.width) / texw; - let b = texh === 0 ? 0 : (rect.y + rect.height) / texh; - let t = texh === 0 ? 0 : rect.y / texh; if (frame._rotated) { + let l = texw === 0 ? 0 : rect.x / texw; + let r = texw === 0 ? 0 : (rect.x + rect.height) / texw; + let b = texh === 0 ? 0 : (rect.y + rect.width) / texh; + let t = texh === 0 ? 0 : rect.y / texh; data[0].u = l; data[0].v = t; data[1].u = l; @@ -71,6 +71,10 @@ module.exports = { data[3].v = b; } else { + let l = texw === 0 ? 0 : rect.x / texw; + let r = texw === 0 ? 0 : (rect.x + rect.width) / texw; + let b = texh === 0 ? 0 : (rect.y + rect.height) / texh; + let t = texh === 0 ? 0 : rect.y / texh; data[0].u = l; data[0].v = b; data[1].u = r;