RenderTexture scale bug

Whenever I change the scale of RenderTexture’s sprite (renderTexture->getSprite()->setScale(1.1f)) when using cocos2d-x 3.0, it is being rendered as flipped on Y axis. It doesn’t matter what value you set, it is always flipped after setScale (if the value is different than previous scale, which is 1.0).
Haven’t had time to debug the problem, since I already spent 2 days to find out what causes the problem. I don’t know if this is platform specific, but I am testing the code on iOS 7.1.

@elvman

I have tested it already , I think it’s should be a bug. But I haven’t figure it out yet.

I tested this problem a little bit and found out that there are problems with matrix calculation. With no calculation, the matrix (renderTexture->getSprite()->getNodeToWorldTransform()) looks like this:
1.000000 0.000000 0.000000 0.000000
0.000000 -1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000

after the transform (renderTexture->getSprite()->setScale(2.0f); renderTexture->getSprite()->setScale(1.0f); ) it looks like this:
1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000

As you can see, scale Y has changed after the transformation.

Sent you a pull request which flips RenderTexture’s sprite instead of setting it’s scaleY to -1.