title: Sprite::createWithTexture with Rect not working as expected
body: <p>I'm trying to build a sprite from an image. Using Image and Texture2D class and then later creating a sprite from the texture2D.</p>
  
  <p>The image I am loading is 512x512 and I expected both versions of the createWithTexture to behave the same but they don't. Here the code:</p>
  
  <pre><code>Image* image = new Image();
  image-&gt;initWithImageFile(fileName);
  
  Texture2D* texture = new Texture2D();
  texture-&gt;initWithImage(image);
  
  //If used this way everything works as expected
  Sprite* spr= Sprite::createWithTexture(texture);
  //If used with a Rect weird result occurrs.
  Sprite* spr= Sprite::createWithTexture(texture,Rect(0,0,512,512));
  spr-&gt;setAnchorPoint(Vec2(0,0));
  spr-&gt;setPosition(Vec2(0,0));
  spr-&gt;setScale(1.0f,1.0f);
  this-&gt;addChild(spr);
  </code></pre>
  
  <p>Here the result of the first one using a Rect:</p>
  
  <p><a href="https://i.stack.imgur.com/N5Mcg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N5Mcg.png" alt="enter image description here"></a></p>
  
  <p>And here the Second version without a Rect:</p>
  
  <p><a href="https://i.stack.imgur.com/I4X7n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I4X7n.png" alt="enter image description here"></a></p>
  
  <p>Do anybody know what is happening? I need to use the method that uses the rect because I will be creating a bunch of sprites from this image in the future.</p>
  
  <p>Edit1: After debugging both versions of the sprite. I have noticed that the one created without the Rect shows a rect of 0,0,240,240. Instead of 0,0,512,512 as I provided. Why 240?</p>
  
  <p>Thanks in advance.</p>