mirror of
https://github.com/konvajs/konva.git
synced 2026-01-09 11:34:38 +08:00
introduced new Context class. I've bumped up the next release to v4.7.0 because this is a relatively big mind shift in how the framework works, and it's a big enough API change to warrant a minor update. This is the first step towards enabling context tracing for stellar unit testing
This commit is contained in:
@@ -196,11 +196,11 @@
|
||||
height: config.height || this.getHeight(),
|
||||
pixelRatio: 1
|
||||
}),
|
||||
context = canvas.getContext(),
|
||||
_context = canvas.getContext()._context,
|
||||
layers = this.children;
|
||||
|
||||
if(x || y) {
|
||||
context.translate(-1 * x, -1 * y);
|
||||
_context.translate(-1 * x, -1 * y);
|
||||
}
|
||||
|
||||
function drawLayer(n) {
|
||||
@@ -209,7 +209,7 @@
|
||||
imageObj = new Image();
|
||||
|
||||
imageObj.onload = function() {
|
||||
context.drawImage(imageObj, 0, 0);
|
||||
_context.drawImage(imageObj, 0, 0);
|
||||
|
||||
if(n < layers.length - 1) {
|
||||
drawLayer(n + 1);
|
||||
@@ -308,7 +308,7 @@
|
||||
|
||||
// draw layer and append canvas to container
|
||||
layer.draw();
|
||||
this.content.appendChild(layer.canvas.element);
|
||||
this.content.appendChild(layer.canvas._canvas);
|
||||
|
||||
// chainable
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user