fix: crash on background-size with calc() (fix #2469) (#2569)

This commit is contained in:
Niklas von Hertzen
2021-07-12 19:09:57 +08:00
committed by GitHub
parent 4555940d0b
commit 084017a673
2 changed files with 5 additions and 0 deletions

View File

@ -91,6 +91,10 @@ export const calculateBackgroundSize = (
): [number, number] => {
const [first, second] = size;
if (!first) {
return [0, 0];
}
if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
}