Skip to content

Commit

Permalink
types fixes, konva-node updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lavrton committed Jul 10, 2019
1 parent 8b38345 commit b798a56
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 1,393 deletions.
4 changes: 4 additions & 0 deletions konva-node/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ setTimeout(function() {
err && console.log(err);
console.log('See out.png');
});
// now try to create image from url
Konva.Image.fromURL(data, () => {
// shoul'd throw
});
}
});
};
Expand Down
7 changes: 7 additions & 0 deletions konva-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Konva.Util.createCanvasElement = () => {
return node;
};

// create canvas in Node env
Konva.Util.createImageElement = () => {
const node = new canvas.Image();
node.style = {};
return node;
};

// _checkVisibility use dom element, in node we can skip it
Konva.Stage.prototype._checkVisibility = () => {};

Expand Down
Loading

0 comments on commit b798a56

Please sign in to comment.