mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Rename FillRule variants to follow the same rules as other enums
This commit is contained in:
parent
bac8781cc7
commit
09e304adb3
3 changed files with 6 additions and 6 deletions
|
@ -707,9 +707,9 @@ pub mod basic_shape {
|
||||||
}
|
}
|
||||||
StyleBasicShapeType::Polygon => {
|
StyleBasicShapeType::Polygon => {
|
||||||
let fill_rule = if other.mFillRule == StyleFillRule::Evenodd {
|
let fill_rule = if other.mFillRule == StyleFillRule::Evenodd {
|
||||||
FillRule::EvenOdd
|
FillRule::Evenodd
|
||||||
} else {
|
} else {
|
||||||
FillRule::NonZero
|
FillRule::Nonzero
|
||||||
};
|
};
|
||||||
let mut coords = Vec::with_capacity(other.mCoordinates.len() / 2);
|
let mut coords = Vec::with_capacity(other.mCoordinates.len() / 2);
|
||||||
for i in 0..(other.mCoordinates.len() / 2) {
|
for i in 0..(other.mCoordinates.len() / 2) {
|
||||||
|
|
|
@ -5101,7 +5101,7 @@ fn static_assert() {
|
||||||
coord.0.to_gecko_style_coord(&mut shape.mCoordinates[2 * i]);
|
coord.0.to_gecko_style_coord(&mut shape.mCoordinates[2 * i]);
|
||||||
coord.1.to_gecko_style_coord(&mut shape.mCoordinates[2 * i + 1]);
|
coord.1.to_gecko_style_coord(&mut shape.mCoordinates[2 * i + 1]);
|
||||||
}
|
}
|
||||||
shape.mFillRule = if poly.fill == FillRule::EvenOdd {
|
shape.mFillRule = if poly.fill == FillRule::Evenodd {
|
||||||
StyleFillRule::Evenodd
|
StyleFillRule::Evenodd
|
||||||
} else {
|
} else {
|
||||||
StyleFillRule::Nonzero
|
StyleFillRule::Nonzero
|
||||||
|
|
|
@ -118,8 +118,8 @@ pub struct Polygon<LengthOrPercentage> {
|
||||||
// https://www.w3.org/TR/SVG/painting.html#FillRuleProperty
|
// https://www.w3.org/TR/SVG/painting.html#FillRuleProperty
|
||||||
// says that it can also be `inherit`
|
// says that it can also be `inherit`
|
||||||
define_css_keyword_enum!(FillRule:
|
define_css_keyword_enum!(FillRule:
|
||||||
"nonzero" => NonZero,
|
"nonzero" => Nonzero,
|
||||||
"evenodd" => EvenOdd
|
"evenodd" => Evenodd
|
||||||
);
|
);
|
||||||
add_impls_for_keyword_enum!(FillRule);
|
add_impls_for_keyword_enum!(FillRule);
|
||||||
|
|
||||||
|
@ -239,5 +239,5 @@ impl<L: ToCss> ToCss for Polygon<L> {
|
||||||
|
|
||||||
impl Default for FillRule {
|
impl Default for FillRule {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn default() -> Self { FillRule::NonZero }
|
fn default() -> Self { FillRule::Nonzero }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue