added a check in Sprite#rotate()