Opt out of bounds on type params for #[derive(ComputeSquaredDistance)]

This commit is contained in:
Anthony Ramine 2018-03-11 14:53:33 +01:00
parent 5cc2d7c4b3
commit 6f7425059c
2 changed files with 70 additions and 35 deletions

View file

@ -18,6 +18,7 @@ use values::distance::{ComputeSquaredDistance, SquaredDistance};
#[animate(no_bound(UrlPaintServer))]
#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq)]
#[derive(ToAnimatedValue, ToComputedValue, ToCss)]
#[distance(no_bound(UrlPaintServer))]
pub struct SVGPaint<ColorType, UrlPaintServer> {
/// The paint source
pub kind: SVGPaintKind<ColorType, UrlPaintServer>,
@ -33,6 +34,7 @@ pub struct SVGPaint<ColorType, UrlPaintServer> {
#[animate(no_bound(UrlPaintServer))]
#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq)]
#[derive(ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
#[distance(no_bound(UrlPaintServer))]
pub enum SVGPaintKind<ColorType, UrlPaintServer> {
/// `none`
#[animation(error)]
@ -205,7 +207,11 @@ pub enum SVGLength<LengthType> {
pub enum SVGStrokeDashArray<LengthType> {
/// `[ <length> | <percentage> | <number> ]#`
#[css(comma)]
Values(#[css(if_empty = "none", iterable)] Vec<LengthType>),
Values(
#[css(if_empty = "none", iterable)]
#[distance(field_bound)]
Vec<LengthType>,
),
/// `context-value`
ContextValue,
}