From 940c77f6c94ef8a48525d8d12f28ced1e7a4a75d Mon Sep 17 00:00:00 2001 From: Mitar Date: Sat, 29 Jun 2013 20:24:07 -0700 Subject: [PATCH] instanceof HTMLElement does not work in jsdom node.js module. --- src/display/canvas.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/display/canvas.js b/src/display/canvas.js index 6476b1eb4..d5c4b9edc 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -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);