Function restrictRotateByHandler