Rotating a square on an HTML5 Canvas so that it always fits in the corner. Move the mouse over the canvas to see the result.