flipping and rotation on the canvas