Code

While rotating, don't try snapping points coincident with the rotation center