Implement radial gradients for borders.

The property border-image-outset is not yet implemented.
Note: Also support repeating-linear-gradients for borders.
This commit is contained in:
Pyfisch 2017-04-30 22:36:45 +02:00
parent a956e3fd52
commit b230be8aaf
3 changed files with 50 additions and 3 deletions

View file

@ -976,12 +976,23 @@ pub struct GradientBorder {
pub outset: SideOffsets2D<f32>,
}
/// A border that is made of radial gradient
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
pub struct RadialGradientBorder {
/// The gradient info that this border uses, border-image-source.
pub gradient: RadialGradient,
/// Outsets for the border, as per border-image-outset.
pub outset: SideOffsets2D<f32>,
}
/// Specifies the type of border
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
pub enum BorderDetails {
Normal(NormalBorder),
Image(ImageBorder),
Gradient(GradientBorder),
RadialGradient(RadialGradientBorder),
}
/// Paints a border.