<commit_before>function Geometry(props, children) {

  this.init(props || {})
  this.children = children || []
  this.update()

}

Geometry.prototype.update = function(context) {

  var self = this

  self.points = self.transform.apply(self.points)

  if (self.parent) self.points = self.parent.transform.apply(self.points)

  if (self.children.length) {
    _.forEach(self.children, function(child) {
      child.parent = self
      child.update()
    })
  }

}

Geometry.prototype.draw = function(context, points) {

  context.beginPath()
  _.forEach(points, function(point) {
    context.lineTo(point[0], point[1])
  })
  context.closePath()
  context.fillStyle = this.props.fill
  context.strokeStyle = this.props.stroke
  context.fill()
  context.stroke()

}

Geometry.prototype.render = function(context, camera) {

  var points = this.points
  points = camera.transform.apply(points)
  this.draw(context, points)

  if (this.children) {
    this.children.forEach(function (child) {
      child.render(context, camera)
    })
  }

}

module.exports = Geometry<commit_msg>Add offset to render<commit_after>function Geometry(props, children) {

  this.init(props || {})
  this.children = children || []
  this.update()

}

Geometry.prototype.update = function(context) {

  var self = this

  self.points = self.transform.apply(self.points)

  if (self.parent) self.points = self.parent.transform.apply(self.points)

  if (self.children.length) {
    _.forEach(self.children, function(child) {
      child.parent = self
      child.update()
    })
  }

}

Geometry.prototype.draw = function(context, points) {

  context.beginPath()
  _.forEach(points, function(point) {
    context.lineTo(point[0], point[1])
  })
  context.closePath()
  context.fillStyle = this.props.fill
  context.strokeStyle = this.props.stroke
  context.fill()
  context.stroke()

}

Geometry.prototype.render = function(context, camera) {
  var points = this.points

  points = camera.transform.invert(points)
  points = points.map(function (point) {
    return [point[0] + camera.game.width/2, point[1] + camera.game.height/2]
  })
  this.draw(context, points)

  if (this.children) {
    this.children.forEach(function (child) {
      child.render(context, camera)
    })
  }

}

module.exports = Geometry
{'fraction_non_alphanumeric': 0.14310722100656456, 'fraction_numerical': 0.00350109409190372, 'mean_word_length': 3.572, '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': '1112188', 'n_tokens_mistral': 751, 'n_tokens_neox': 732, 'n_words': 126}