0, canvas.width, canvas.height);
        drawGrid('lightgray', 10, 10);
        drawPolygons();
    }

    editCheckbox.onchange = function (e) {
        if (editCheckbox.checked) {
            startEditing();
        }
        else {
            stopEditing();
        }
    };

    // Initialization................................................

    context.strokeStyle = strokeStyleSelect.value;
    context.fillStyle = fillStyleSelect.value;

    drawGrid('lightgray', 10, 10);

    if (navigator.userAgen