added support for gradient background size and fixed linear gradient angle when vendor prefix is used

This commit is contained in:
MoyuScript
2017-12-09 23:07:27 +01:00
parent 768ca87e50
commit 2d46176540
4 changed files with 97 additions and 11 deletions

View File

@@ -123,6 +123,19 @@ export const calculateBackgroundSize = (
return new Size(width, height);
};
export const calculateGradientBackgroundSize = (
backgroundImage: BackgroundImage,
bounds: Bounds
): Size => {
const size = backgroundImage.size;
const width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
const height = size[1].value
? size[1].value.getAbsoluteValue(bounds.height)
: size[0].value ? width : bounds.height;
return new Size(width, height);
};
const AUTO_SIZE = new BackgroundSize(AUTO);
export const calculateBackgroungPaintingArea = (