title: WPF Canvas.Left / Canvas.Top are not quite the right coordinates when rotated, why?
body: <p>I have a weird but big problem. 
   I am trying to let the user move / rotate some Rectangles on a Canvas. I am basing my mechanism on manipulating Canvas.Left / Canvas.Top properties for move, and RenderTransform.Rotate for rotation. I only need rotation on 0/90/180/270 angles.</p>
  
  <p>The problem is that a rectangle, which is placed at coordinates 0.0 on a 0 angle rotation shows ok, but the same rectangle at 0.0 with 90 angle rotation shows the element at other coordinates than 0.0. As I see, the coordinates are always right in the case the rotation is 0 or 180, but wrong in the case of 90 / 270.
   The differencee between what coordinates are set and what the user sees, is related to the difference between the Height and Width. </p>
  
  <p>Has anyone run into this sort of problem before? </p>
  
  <p>Thank you,
   Daniell</p>
  
  <p>edit:</p>
  
  <p>Sure, here is some xaml:</p>
  
  <blockquote>
    <p>
  
  <pre><code>    &lt;Canvas 
          Height="500" 
          Width="500"
          Background="Green"
  
          &lt;Rectangle 
              Canvas.Left="0" 
              Canvas.Top="0"
              Height="50"
              Width="100"
              RenderTransformOrigin="0.5,0.5"
              Fill="Red"
  
              &lt;Rectangle.RenderTransform&gt;
                  &lt;RotateTransform 
                  Angle="90"
                  /&gt;
              &lt;/Rectangle.RenderTransform&gt;
          &lt;/Rectangle&gt;
          &lt;Rectangle 
              Canvas.Left="0" 
              Canvas.Top="0"
              Height="50"
              Width="100"
              RenderTransformOrigin="0.5,0.5"
              Fill="RoyalBlue"
  
              &lt;Rectangle.RenderTransform&gt;
                  &lt;RotateTransform 
                  Angle="0"
                  /&gt;
              &lt;/Rectangle.RenderTransform&gt;
          &lt;/Rectangle&gt;
      &lt;/Canvas&gt; 
  &lt;/Grid&gt;
  </code></pre>
  </blockquote>
  
  <p>as you can see, the blue rectangle seems correctly placed (0,0) but the red one shows at different coordinates, even if it returns stil 0,0.</p>
  
  <p>I have found that the Formula:</p>
  
  <p>displayPointX = Canvas.Left + height /2 - width / 2</p>
  
  <p>diaplayPointY = Canvas.Top + height /2 - width/2</p>