Skip to content

Commit

Permalink
Merge pull request #9588 from swftvsn/patch-1
Browse files Browse the repository at this point in the history
Improve node.js support
  • Loading branch information
timvandermeij committed Apr 1, 2018
2 parents 8512596 + c20426e commit 8887a09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -2112,8 +2112,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
var heightScale = Math.max(Math.sqrt(c * c + d * d), 1);

var imgToPaint, tmpCanvas;
// instanceof HTMLElement does not work in jsdom node.js module
if (imgData instanceof HTMLElement || !imgData.data) {
// typeof check is needed due to node.js support, see issue #8489
if ((typeof HTMLElement === 'function' &&
imgData instanceof HTMLElement) || !imgData.data) {
imgToPaint = imgData;
} else {
tmpCanvas = this.cachedCanvases.getCanvas('inlineImage',
Expand Down

0 comments on commit 8887a09

Please sign in to comment.