mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Use correct window size for cloned iframe
This commit is contained in:
parent
440120b087
commit
3b8d4dece2
7
dist/html2canvas.js
vendored
7
dist/html2canvas.js
vendored
@ -581,7 +581,7 @@ window.html2canvas = function(nodeList, options) {
|
|||||||
|
|
||||||
var node = ((nodeList === undefined) ? [document.documentElement] : ((nodeList.length) ? nodeList : [nodeList]))[0];
|
var node = ((nodeList === undefined) ? [document.documentElement] : ((nodeList.length) ? nodeList : [nodeList]))[0];
|
||||||
node.setAttribute(html2canvasNodeAttribute, "true");
|
node.setAttribute(html2canvasNodeAttribute, "true");
|
||||||
return renderDocument(node.ownerDocument, options, window.innerWidth, window.innerHeight).then(function(canvas) {
|
return renderDocument(node.ownerDocument, options, node.ownerDocument.defaultView.innerWidth, node.ownerDocument.defaultView.innerHeight).then(function(canvas) {
|
||||||
if (typeof(options.onrendered) === "function") {
|
if (typeof(options.onrendered) === "function") {
|
||||||
log("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");
|
log("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");
|
||||||
options.onrendered(canvas);
|
options.onrendered(canvas);
|
||||||
@ -791,10 +791,7 @@ function FrameContainer(container, sameOrigin, proxy) {
|
|||||||
resolve(container);
|
resolve(container);
|
||||||
}
|
}
|
||||||
})).then(function(container) {
|
})).then(function(container) {
|
||||||
return html2canvas(container.contentWindow.document.documentElement, {
|
return html2canvas(container.contentWindow.document.documentElement, {type: 'view', proxy: proxy});
|
||||||
width: bounds.width,
|
|
||||||
height: bounds.height
|
|
||||||
});
|
|
||||||
}).then(function(canvas) {
|
}).then(function(canvas) {
|
||||||
return self.image = canvas;
|
return self.image = canvas;
|
||||||
});
|
});
|
||||||
|
2
dist/html2canvas.min.js
vendored
2
dist/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@ window.html2canvas = function(nodeList, options) {
|
|||||||
|
|
||||||
var node = ((nodeList === undefined) ? [document.documentElement] : ((nodeList.length) ? nodeList : [nodeList]))[0];
|
var node = ((nodeList === undefined) ? [document.documentElement] : ((nodeList.length) ? nodeList : [nodeList]))[0];
|
||||||
node.setAttribute(html2canvasNodeAttribute, "true");
|
node.setAttribute(html2canvasNodeAttribute, "true");
|
||||||
return renderDocument(node.ownerDocument, options, window.innerWidth, window.innerHeight).then(function(canvas) {
|
return renderDocument(node.ownerDocument, options, node.ownerDocument.defaultView.innerWidth, node.ownerDocument.defaultView.innerHeight).then(function(canvas) {
|
||||||
if (typeof(options.onrendered) === "function") {
|
if (typeof(options.onrendered) === "function") {
|
||||||
log("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");
|
log("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");
|
||||||
options.onrendered(canvas);
|
options.onrendered(canvas);
|
||||||
|
@ -12,10 +12,7 @@ function FrameContainer(container, sameOrigin, proxy) {
|
|||||||
resolve(container);
|
resolve(container);
|
||||||
}
|
}
|
||||||
})).then(function(container) {
|
})).then(function(container) {
|
||||||
return html2canvas(container.contentWindow.document.documentElement, {
|
return html2canvas(container.contentWindow.document.documentElement, {type: 'view', proxy: proxy});
|
||||||
width: bounds.width,
|
|
||||||
height: bounds.height
|
|
||||||
});
|
|
||||||
}).then(function(canvas) {
|
}).then(function(canvas) {
|
||||||
return self.image = canvas;
|
return self.image = canvas;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user