 e.preventDefault(); // prevent selections

        if (rotatingLockEngaged) {
            angle = Math.atan((loc.y - polygonRotating.y) /
                (loc.x - polygonRotating.x))
                - rotatingLockAngle;

            redraw();

            drawPolygon(polygonRotating, angle);
            drawRotationAnnotations(loc);
        }
        else if (dragging) {
            restoreDrawingSurface();
            updateRubberband(loc, sides, startAngle);

            if (guidewires) {
               