<commit_before>'use strict';

function draw_logic(){
    // If mouse down, draw current unsaved box.
    if(input_mouse['down']){
        canvas_buffer.beginPath();
        canvas_buffer.rect(
          input_mouse['down-x'],
          input_mouse['down-y'],
          input_mouse['x'] - input_mouse['down-x'],
          input_mouse['y'] - input_mouse['down-y']
        );
        canvas_buffer.closePath();
        canvas_buffer.stroke();
    }

    // Draw saved boxen.
    for(var box in boxen){
        canvas_buffer.beginPath();
        canvas_buffer.rect(
          boxen[box]['x'],
          boxen[box]['y'],
          boxen[box]['width'],
          boxen[box]['height']
        );
        canvas_buffer.closePath();
        canvas_buffer.stroke();
    }

    canvas_buffer.fillText(
      'Click + Drag! ESC = Clear! '
        + boxen.length + '!',
      5,
      25
    );
}

function resize_logic(){
    canvas_buffer.fillStyle = '#fff';
    canvas_buffer.strokeStyle = '#fff';
    canvas_draw();
}

var boxen = [];

window.onload = function(e){
    canvas_init();
    input_init(
      {
        27: {
          'todo': function(){
              boxen = [];
              canvas_draw();
          },
        },
      },
      {
        'mousemove': {
          'todo': function(){
              if(!input_mouse['down']){
                  return;
              }
              canvas_draw();
          },
        },
        'mouseup': {
          'todo': function(){
              boxen.push({
                'height': input_mouse['y'] - input_mouse['down-y'],
                'width': input_mouse['x'] - input_mouse['down-x'],
                'x': input_mouse['down-x'],
                'y': input_mouse['down-y'],
              });
              canvas_draw();
          },
        },
      }
    );
};<commit_msg>removed extra canvas_draw() calls<commit_after>'use strict';

function draw_logic(){
    // If mouse down, draw current unsaved box.
    if(input_mouse['down']){
        canvas_buffer.beginPath();
        canvas_buffer.rect(
          input_mouse['down-x'],
          input_mouse['down-y'],
          input_mouse['x'] - input_mouse['down-x'],
          input_mouse['y'] - input_mouse['down-y']
        );
        canvas_buffer.closePath();
        canvas_buffer.stroke();
    }

    // Draw saved boxen.
    for(var box in boxen){
        canvas_buffer.beginPath();
        canvas_buffer.rect(
          boxen[box]['x'],
          boxen[box]['y'],
          boxen[box]['width'],
          boxen[box]['height']
        );
        canvas_buffer.closePath();
        canvas_buffer.stroke();
    }

    canvas_buffer.fillText(
      'Click + Drag! ESC = Clear! '
        + boxen.length + '!',
      5,
      25
    );
}

function resize_logic(){
    canvas_buffer.fillStyle = '#fff';
    canvas_buffer.strokeStyle = '#fff';
}

var boxen = [];

window.onload = function(e){
    canvas_init();
    input_init(
      {
        27: {
          'todo': function(){
              boxen = [];
          },
        },
      },
      {
        'mouseup': {
          'todo': function(){
              boxen.push({
                'height': input_mouse['y'] - input_mouse['down-y'],
                'width': input_mouse['x'] - input_mouse['down-x'],
                'x': input_mouse['down-x'],
                'y': input_mouse['down-y'],
              });
          },
        },
      }
    );
};
{'fraction_non_alphanumeric': 0.16300205218411024, 'fraction_numerical': 0.002931691586045148, 'mean_word_length': 1.5712132629992464, 'pattern_counts': {'":': 0, '<': 3, '<?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': '181667', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1017, 'n_words': 162}