Commit 9b898cff authored by Viktor Lidholt's avatar Viktor Lidholt

Adds optional rect property to sprite layer class

parent 0a02ea45
part of sprites; part of sprites;
class Layer extends Node with SpritePaint { class Layer extends Node with SpritePaint {
Rect layerRect;
Layer([Rect this.layerRect = null]);
Paint _cachedPaint = new Paint() Paint _cachedPaint = new Paint()
..setFilterQuality(FilterQuality.low) ..setFilterQuality(FilterQuality.low)
..isAntiAlias = false; ..isAntiAlias = false;
...@@ -9,7 +13,7 @@ class Layer extends Node with SpritePaint { ...@@ -9,7 +13,7 @@ class Layer extends Node with SpritePaint {
super._prePaint(canvas, matrix); super._prePaint(canvas, matrix);
_updatePaint(_cachedPaint); _updatePaint(_cachedPaint);
canvas.saveLayer(null, _cachedPaint); canvas.saveLayer(layerRect, _cachedPaint);
} }
void _postPaint(PaintingCanvas canvas, Matrix4 totalMatrix) { void _postPaint(PaintingCanvas canvas, Matrix4 totalMatrix) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment