tion (e) {
        context.strokeStyle = strokeStyleSelect.value;
    };

    fillStyleSelect.onchange = function (e) {
        context.fillStyle = fillStyleSelect.value;
    };

    function startEditing() {
        canvas.style.cursor = 'pointer';
        editing = true;
    }

    function stopEditing() {
        canvas.style.cursor = 'crosshair';
        editing = false;
        polygonRotating = undefined;
        rotatingLockEngaged = false;
        rotatingLockAngle = 0;
        context.clearRect(0, 