mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
parent
4555940d0b
commit
084017a673
@ -91,6 +91,10 @@ export const calculateBackgroundSize = (
|
|||||||
): [number, number] => {
|
): [number, number] => {
|
||||||
const [first, second] = size;
|
const [first, second] = size;
|
||||||
|
|
||||||
|
if (!first) {
|
||||||
|
return [0, 0];
|
||||||
|
}
|
||||||
|
|
||||||
if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
|
if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
|
||||||
return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
|
return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
<div style='background-size: auto;'></div>
|
<div style='background-size: auto;'></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container" style="padding: 10px; background-size: contain; background-origin: content-box; background-clip: content-box"></div>
|
<div class="container" style="padding: 10px; background-size: contain; background-origin: content-box; background-clip: content-box"></div>
|
||||||
|
<div class="container" style="background-size: calc(100% - 10px)"></div>
|
||||||
<div class="sliver">
|
<div class="sliver">
|
||||||
<div></div>
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user