title: Scaling and repositioning a sprite
body: <p><img src="https://i.stack.imgur.com/VDQrv.png" alt="Scale"></p>
  
  <p>I am trying to scale a rectangle on the X axis and keep it's position the same as it was. Normally when you scale sprite or object in Unity3D it's from it's center and expands on both sides of the  given axis. What i tried is: </p>
  
  <ol>
  <li>Scale the object on the X axis with some value.</li>
  <li>Reposition it half the given scaling size back.</li>
  </ol>
  
  <p>When i perform these two steps, somehow i get near the desired result, but the object still expands with some very small amount on the opposite side.</p>
  
  <pre><code>private float m_scaleSize = 1.1600f;
  
  private void Update()
  {  
      transform.localPosition -= new Vector3(0, m_scaleSize / 2, 0) * Time.deltaTime;    
      transform.localScale += new Vector3(0, m_scaleSize, 0) * Time.deltaTime;     
  }
  </code></pre>
  
  <p>Why am i getting almost the correct result? Is this some floating point imprecision or my math is totally wrong? I also want to point out that i am looking for the math solution and achieve this without parenting it to some other object in order to get this effect.</p>