imited(dy(x, y) * (0.5 - dx_from_linear(x, y)[0]) * grid_size * shiftd);
}



function init_canvas(){
    var canvas = document.getElementById("canvas");
    canvas.addEventListener('mousedown', function(e){
        canvas_rect = canvas.getBoundingClientRect();
    }, false);
     
    canvas.addEventListener('mousemove', function(e){
        if(e.buttons == 1){
            canvas_rect = canvas.getBoundingClientRect();
            draw_canvas();
        }
    }, false);
    
    canvas.addEventListener('mou