File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -239,13 +239,18 @@ -(void) setTextureRect:(CGRect)rect
239239
240240-(void ) setTextureRect : (CGRect)rect rotated : (BOOL )rotated untrimmedSize : (CGSize)untrimmedSize
241241{
242- _textureRectRotated = rotated;
242+ [self setTextureRect: rect forTexture: self .texture rotated: rotated untrimmedSize: untrimmedSize];
243+ }
243244
245+ - (void )setTextureRect : (CGRect)rect forTexture : (CCTexture*)texture rotated : (BOOL )rotated untrimmedSize : (CGSize)untrimmedSize
246+ {
247+ _textureRectRotated = rotated;
248+
244249 self.contentSizeType = CCSizeTypePoints;
245250 [self setContentSize: untrimmedSize];
246251 _textureRect = rect;
247252
248- CCSpriteTexCoordSet texCoords = [CCSprite textureCoordsForTexture: self . texture withRect: rect rotated: rotated xFlipped: _flipX yFlipped: _flipY];
253+ CCSpriteTexCoordSet texCoords = [CCSprite textureCoordsForTexture: texture withRect: rect rotated: rotated xFlipped: _flipX yFlipped: _flipY];
249254 _verts.bl .texCoord1 = texCoords.bl ;
250255 _verts.br .texCoord1 = texCoords.br ;
251256 _verts.tr .texCoord1 = texCoords.tr ;
@@ -533,7 +538,7 @@ -(void) setNormalMapSpriteFrame:(CCSpriteFrame*)frame
533538 // If there is no texture set on the sprite, set the sprite's texture rect from the
534539 // normal map's sprite frame. Note that setting the main texture, then the normal map,
535540 // and then removing the main texture will leave the texture rect from the main texture.
536- [self setTextureRect: frame.rect rotated: frame.rotated untrimmedSize: frame.originalSize];
541+ [self setTextureRect: frame.rect forTexture: frame.texture rotated: frame.rotated untrimmedSize: frame.originalSize];
537542 }
538543
539544 // Set the second texture coordinate set from the normal map's sprite frame.
You can’t perform that action at this time.
0 commit comments