Merge pull request #10399 from MohammedEssehemy/master

migrate to canvas 2.x api
This commit is contained in:
Tim van der Meij 2019-01-03 23:32:56 +01:00 committed by GitHub
commit 5a2bd9fc63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,