You have to use TargetTranslation to move the origin to 640,360. This still won't do what you want if you want to rotate the object around its midpoint. If that's what you want, you have to set the TargetRect values to minus half the width and height. For example, the screensaver for Video Poker rotates the cards like this:
item = [{ url:url,TargetRect:{x:Int(-cardw/2), y:Int(-cardh/2), w:cardw, h:cardh},TargetRotation:r,TargetTranslation:{x:x,y:y}}]
canvas.SetLayer(1,item)
r, x, and y are random
By the way, if you're rotating a square and the corners are no longer 90 degrees, it's you display that's the problem. Also, it's hard to make a square maintain it's aspect ratio on an SD screen since everything has to be stretched slightly horizontally to maintain aspect ratio. On an HD screen, a square should always be a square.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.