instanceof HTMLElement does not work in jsdom node.js module.

This commit is contained in:
Mitar 2013-06-29 20:24:07 -07:00
parent 4f243b39b4
commit 940c77f6c9

View File

@ -1709,7 +1709,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
var heightScale = Math.max(Math.sqrt(c * c + d * d), 1);
var imgToPaint;
if (imgData instanceof HTMLElement) {
// instanceof HTMLElement does not work in jsdom node.js module
if (imgData instanceof HTMLElement || !imgData.data) {
imgToPaint = imgData;
} else {
var tmpCanvas = CachedCanvases.getCanvas('inlineImage', width, height);