Skip to content

CCSprite.setTextureRect Modification #41

Open
irwinb opened this Issue Oct 1, 2011 · 1 comment

2 participants

@irwinb
irwinb commented Oct 1, 2011

The setTextureRect call should probably be

public void setFlipY(boolean b) {
        if( flipY_ != b ) {
            flipY_ = b; 
            setTextureRect(rect_, contentSize_, rectRotated_);
        }   
    }

instead of

public void setFlipY(boolean b) {
        if( flipY_ != b ) {
            flipY_ = b; 
            setTextureRect(rect_); // uses rect_.size instead of contentSize_
        }   
    }

I noticed this when calling flipY( and flipX for that matter) which then starts the setTextureRect chain. The problem occurs, as I've seen, for frames on sprite sheets whose transparent pixels have been cut out to reduce the space they take.

@ZhouWeikuan
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.