migrate to canvas 2.x api

This commit is contained in:
Mohammed Essehemy 2019-01-02 01:10:07 +02:00
parent 1b84b2ed60
commit f0e9df745c
No known key found for this signature in database
GPG Key ID: 2BE9817896EB585A

View File

@ -21,7 +21,7 @@ function NodeCanvasFactory() {}
NodeCanvasFactory.prototype = {
create: function NodeCanvasFactory_create(width, height) {
assert(width > 0 && height > 0, 'Invalid canvas size');
var canvas = new Canvas(width, height);
var canvas = Canvas.createCanvas(width, height);
var context = canvas.getContext('2d');
return {
canvas: canvas,