Add snap field to rule::Style
This commit is contained in:
parent
54a9f1b770
commit
7afbb89ebf
1 changed files with 4 additions and 1 deletions
|
|
@ -167,7 +167,7 @@ where
|
||||||
renderer::Quad {
|
renderer::Quad {
|
||||||
bounds,
|
bounds,
|
||||||
border: border::rounded(style.radius),
|
border: border::rounded(style.radius),
|
||||||
snap: true,
|
snap: style.snap,
|
||||||
..renderer::Quad::default()
|
..renderer::Quad::default()
|
||||||
},
|
},
|
||||||
style.color,
|
style.color,
|
||||||
|
|
@ -198,6 +198,8 @@ pub struct Style {
|
||||||
pub radius: border::Radius,
|
pub radius: border::Radius,
|
||||||
/// The [`FillMode`] of the rule.
|
/// The [`FillMode`] of the rule.
|
||||||
pub fill_mode: FillMode,
|
pub fill_mode: FillMode,
|
||||||
|
/// Whether the rule should be snapped to the pixel grid.
|
||||||
|
pub snap: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The fill mode of a rule.
|
/// The fill mode of a rule.
|
||||||
|
|
@ -302,5 +304,6 @@ pub fn default(theme: &Theme) -> Style {
|
||||||
width: 1,
|
width: 1,
|
||||||
radius: 0.0.into(),
|
radius: 0.0.into(),
|
||||||
fill_mode: FillMode::Full,
|
fill_mode: FillMode::Full,
|
||||||
|
snap: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue