<commit_before>part of sprites;

class Layer extends Node with SpritePaint {
  Paint _cachedPaint = new Paint()
    ..setFilterQuality(FilterQuality.low)
    ..isAntiAlias = false;

  void _prePaint(PaintingCanvas canvas, Matrix4 matrix) {
    super._prePaint(canvas, matrix);

    _updatePaint(_cachedPaint);
    canvas.saveLayer(null, _cachedPaint);
  }

  void _postPaint(PaintingCanvas canvas, Matrix4 totalMatrix) {
    canvas.restore();
    super._postPaint(canvas, totalMatrix);
  }
}<commit_msg>Adds optional rect property to sprite layer class<commit_after>part of sprites;

class Layer extends Node with SpritePaint {
  Rect layerRect;

  Layer([Rect this.layerRect = null]);

  Paint _cachedPaint = new Paint()
    ..setFilterQuality(FilterQuality.low)
    ..isAntiAlias = false;

  void _prePaint(PaintingCanvas canvas, Matrix4 matrix) {
    super._prePaint(canvas, matrix);

    _updatePaint(_cachedPaint);
    canvas.saveLayer(layerRect, _cachedPaint);
  }

  void _postPaint(PaintingCanvas canvas, Matrix4 totalMatrix) {
    canvas.restore();
    super._postPaint(canvas, totalMatrix);
  }
}
{'fraction_non_alphanumeric': 0.09764918625678119, 'fraction_numerical': 0.003616636528028933, 'mean_word_length': 4.4, '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': '6483963', 'n_tokens_mistral': 354, 'n_tokens_neox': 324, 'n_words': 80}