<commit_before>// drawcontext.js
//
// Replaces the 2d context from canvas and allows sprites and tiles and things
// to draw themselves without having to account for where they are in the
// canvas. The game object does that. And this thing handles it.

(function(global, $) {
  
  var drawcontext = function(ctx) {
    var that = {};
    that.offset = {
      x: 0,
      y: 0
    };
    
    that.fillStyle = function(fill) {
      ctx.fillStyle = fill;
    };
    
    that.fillRect = function(x, y, w, h) {
      ctx.fillRect(Math.round(x + that.offset.x), Math.round(y + that.offset.y), Math.round(w), Math.round(h));
    };
    
    that.drawImage = function(img, x, y) {
      ctx.drawImage(img, Math.round(x + that.offset.x), Math.round(y + that.offset.y));
    };
    
    return that;
  };
  
  global.drawcontext = drawcontext;
  
})(window, jQuery)<commit_msg>needed some more methods on the drawcontext<commit_after>// drawcontext.js
//
// Replaces the 2d context from canvas and allows sprites and tiles and things
// to draw themselves without having to account for where they are in the
// canvas. The game object does that. And this thing handles it.

(function(global, $) {
  
  var drawcontext = function(ctx) {
    var that = {};
    that.offset = {
      x: 0,
      y: 0
    };
    
    that.fillStyle = function(fill) {
      ctx.fillStyle = fill;
    };
    
    that.strokeStyle = function(stroke) {
      ctx.strokeStyle = stroke;
    }
    
    that.lineWidth = function(width) {
      ctx.lineWidth = width;
    }
    
    that.fillRect = function(x, y, w, h) {
      ctx.fillRect(Math.round(x + that.offset.x), Math.round(y + that.offset.y), Math.round(w), Math.round(h));
    };
    
    that.strokeRect = function(x, y, w, h) {
      ctx.strokeRect(Math.round(x + that.offset.x), Math.round(y + that.offset.y), Math.round(w), Math.round(h));
    }
    
    that.drawImage = function(img, x, y) {
      ctx.drawImage(img, Math.round(x + that.offset.x), Math.round(y + that.offset.y));
    };
    
    return that;
  };
  
  global.drawcontext = drawcontext;
  
})(window, jQuery)
{'fraction_non_alphanumeric': 0.14028436018957346, 'fraction_numerical': 0.002843601895734597, 'mean_word_length': 2.460655737704918, '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': '4849035', 'n_tokens_mistral': 719, 'n_tokens_neox': 704, 'n_words': 184}