<commit_before>var drawLine = function(sx, sy, dx, dy) {
    gfx.ctx.beginPath();
    gfx.ctx.moveTo(sx, sy);
    gfx.ctx.lineTo(dx, dy);
    gfx.ctx.stroke();
}

var drawWorld = function(world) {

    drawGrid(world);
}

var drawGrid = function(world) {

    for (var x = 0; x <= world.getWidth(); x++) {
        var cell_x = (camera.getWidth() / world.getWidth()) * x;
        drawLine(cell_x, 0, cell_x, camera.getHeight());
    }

    for (var y = 0; y <= world.getHeight(); y++) {
        var cell_y = (camera.getHeight() / world.getHeight()) * y;
        drawLine(0, cell_y, camera.getWidth(), cell_y);
    }
}<commit_msg>Improve grid rendering with new camera methods<commit_after>var drawLine = function(sx, sy, dx, dy) {
    gfx.ctx.beginPath();
    gfx.ctx.moveTo(sx, sy);
    gfx.ctx.lineTo(dx, dy);
    gfx.ctx.stroke();
}

var drawWorld = function(world) {

    drawGrid(world);
}

    gfx.ctx.strokeStyle = "#000000";
    for (var x = 0; x <= world.getWidth(); x++) {
        var draw_x = camera.transformToCameraSpace(x, 0).cam_x;
        var top = camera.transformToCameraSpace(x, 0).cam_y;
        var bot = camera.transformToCameraSpace(x, world.getHeight()).cam_y;
        drawLine(draw_x, top, draw_x, bot);
    }

    for (var y = 0; y <= world.getHeight(); y++) {
        var draw_y = camera.transformToCameraSpace(0, y).cam_y;
        var left = camera.transformToCameraSpace(0, y).cam_x;
        var right = camera.transformToCameraSpace(world.getWidth(), y).cam_x;
        drawLine(left, draw_y, right, draw_y);
    }
}
{'fraction_non_alphanumeric': 0.163860103626943, 'fraction_numerical': 0.010362694300518135, 'mean_word_length': 2.9615384615384617, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3349008', 'n_tokens_mistral': 579, 'n_tokens_neox': 554, 'n_words': 121}