<commit_before>define([
  './draw/shape',
  './state',
  'lodash'
], function(drawShape, state, _){

  'use strict';

  return function(ctx){
    if(state.backImg){
      ctx.drawImage(state.backImg, 0, 0, this.canvas.width, state.backImg.height);
    } else {
      ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
    }

    _.forEach(this.entities, function(entity){
      if(!entity.staticBody || state.showStatic){
        entity.draw(ctx);
      }
    });

    if(!state.geometries.length){
      return;
    }

    drawShape[state.tool](ctx, this.inputManager, state.geometries);
  };

});<commit_msg>change tool to create<commit_after>define([
  './draw/shape',
  './state',
  'lodash'
], function(drawShape, state, _){

  'use strict';

  return function(ctx){
    if(state.backImg){
      ctx.drawImage(state.backImg, 0, 0, this.canvas.width, state.backImg.height);
    } else {
      ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
    }

    _.forEach(this.entities, function(entity){
      if(!entity.staticBody || state.showStatic){
        entity.draw(ctx);
      }
    });

    if(!state.geometries.length){
      return;
    }

    drawShape[state.create](ctx, this.inputManager, state.geometries);
  };

});
{'fraction_non_alphanumeric': 0.17307692307692307, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 2.9525316455696204, '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': '4385358', 'n_tokens_mistral': 440, 'n_tokens_neox': 427, 'n_words': 65}