Merge pull request #3416 from peerlibrary/noHTMLElement

instanceof HTMLElement does not work in jsdom node.js module.
This commit is contained in:
Brendan Dahl 2013-10-08 10:15:00 -07:00
commit 6d1533293e

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);