mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: this.canvas.ownerDocument is undefined (#2590)
This commit is contained in:
parent
cd99f11b1b
commit
45efe54da8
@ -552,7 +552,8 @@ export class CanvasRenderer {
|
||||
return image;
|
||||
}
|
||||
|
||||
const canvas = (this.canvas.ownerDocument as Document).createElement('canvas');
|
||||
const ownerDocument = this.canvas.ownerDocument ?? document;
|
||||
const canvas = ownerDocument.createElement('canvas');
|
||||
canvas.width = Math.max(1, width);
|
||||
canvas.height = Math.max(1, height);
|
||||
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;
|
||||
|
Loading…
Reference in New Issue
Block a user