Merge pull request #182 from wangcheng/wangcheng678-patch-1

use image naturalHeight and naturalHeight
This commit is contained in:
Lokesh Dhakar
2020-07-05 21:03:38 -07:00
committed by GitHub

View File

@@ -31,8 +31,8 @@ import core from './core.js';
const CanvasImage = function (image) {
this.canvas = document.createElement('canvas');
this.context = this.canvas.getContext('2d');
this.width = this.canvas.width = image.width;
this.height = this.canvas.height = image.height;
this.width = this.canvas.width = image.naturalWidth;
this.height = this.canvas.height = image.naturalHeight;
this.context.drawImage(image, 0, 0, this.width, this.height);
};