pure-canvas
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "pure-canvas", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "TODO", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -17,5 +17,6 @@ import Layer from './Layer'; | ||
} | ||
context.drawImage(this.cache, 0, 0, this.cache.width, this.cache.height); | ||
const {minX, minY, maxX, maxY} = this.getBounds(); | ||
context.drawImage(this.cache, minX, minY, maxX - minX, maxY - minY); | ||
} | ||
} | ||
}; |
@@ -17,3 +17,6 @@ import Node, {Bounds, Point} from './Node'; | ||
canvas.height = maxY - minY; | ||
this.draw(canvas.getContext('2d')); | ||
const context = canvas.getContext('2d'); | ||
context.translate(-minX, -minY); | ||
this.draw(context); | ||
context.translate(minX, minY); | ||
return canvas; | ||
@@ -20,0 +23,0 @@ } |
Sorry, the diff of this file is not supported yet
143724
1588