mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Use first background repeat value for multiple backgrounds if only 1 available (Edge bug)
This commit is contained in:
parent
09f8f0cf01
commit
8cd182b0d8
@ -128,14 +128,17 @@ export const cloneWindow = (
|
|||||||
if (
|
if (
|
||||||
/(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&
|
/(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&
|
||||||
(cloneWindow.scrollY !== bounds.top ||
|
(cloneWindow.scrollY !== bounds.top ||
|
||||||
cloneWindow.scrollX !== bounds.left)
|
cloneWindow.scrollX !== bounds.left)
|
||||||
) {
|
) {
|
||||||
documentClone.documentElement.style.top = -bounds.top + 'px';
|
documentClone.documentElement.style.top = -bounds.top + 'px';
|
||||||
documentClone.documentElement.style.left = -bounds.left + 'px';
|
documentClone.documentElement.style.left = -bounds.left + 'px';
|
||||||
documentClone.documentElement.style.position = 'absolute';
|
documentClone.documentElement.style.position = 'absolute';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (referenceElementSearch[1] instanceof cloneWindow.HTMLElement || referenceElementSearch[1] instanceof HTMLElement) {
|
if (
|
||||||
|
referenceElementSearch[1] instanceof cloneWindow.HTMLElement ||
|
||||||
|
referenceElementSearch[1] instanceof HTMLElement
|
||||||
|
) {
|
||||||
resolve([cloneIframeContainer, referenceElementSearch[1]]);
|
resolve([cloneIframeContainer, referenceElementSearch[1]]);
|
||||||
} else {
|
} else {
|
||||||
reject(
|
reject(
|
||||||
|
@ -292,7 +292,9 @@ const parseBackgroundImages = (
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
source,
|
source,
|
||||||
repeat: parseBackgroundRepeat(repeats[index]),
|
repeat: parseBackgroundRepeat(
|
||||||
|
typeof repeats[index] === 'string' ? repeats[index] : repeats[0]
|
||||||
|
),
|
||||||
size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
|
size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
|
||||||
position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
|
position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user