mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix pseudoelement image content not being loaded in time
This commit is contained in:
parent
722e907f40
commit
9cce2c3381
@ -135,6 +135,17 @@ export default class NodeContainer {
|
|||||||
node.style.transform = 'matrix(1,0,0,1,0,0)';
|
node.style.transform = 'matrix(1,0,0,1,0,0)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO move bound retrieval for all nodes to a later stage?
|
||||||
|
if (node.tagName === 'IMG') {
|
||||||
|
node.addEventListener('load', () => {
|
||||||
|
this.bounds = parseBounds(node);
|
||||||
|
this.curvedBounds = parseBoundCurves(
|
||||||
|
this.bounds,
|
||||||
|
this.style.border,
|
||||||
|
this.style.borderRadius
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
this.image = getImage(node, imageLoader);
|
this.image = getImage(node, imageLoader);
|
||||||
this.bounds = IS_INPUT ? reformatInputBounds(parseBounds(node)) : parseBounds(node);
|
this.bounds = IS_INPUT ? reformatInputBounds(parseBounds(node)) : parseBounds(node);
|
||||||
this.curvedBounds = parseBoundCurves(
|
this.curvedBounds = parseBoundCurves(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user