mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 13:54:25 +00:00
use image naturalHeightnaturalHeight
This commit is contained in:
@@ -31,8 +31,8 @@ import core from './core.js';
|
|||||||
const CanvasImage = function (image) {
|
const CanvasImage = function (image) {
|
||||||
this.canvas = document.createElement('canvas');
|
this.canvas = document.createElement('canvas');
|
||||||
this.context = this.canvas.getContext('2d');
|
this.context = this.canvas.getContext('2d');
|
||||||
this.width = this.canvas.width = image.width;
|
this.width = this.canvas.width = image.naturalWidth;
|
||||||
this.height = this.canvas.height = image.height;
|
this.height = this.canvas.height = image.naturalHeight;
|
||||||
this.context.drawImage(image, 0, 0, this.width, this.height);
|
this.context.drawImage(image, 0, 0, this.width, this.height);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user