diff --git a/widget/src/rule.rs b/widget/src/rule.rs index b109b103..03c57c94 100644 --- a/widget/src/rule.rs +++ b/widget/src/rule.rs @@ -167,7 +167,7 @@ where renderer::Quad { bounds, border: border::rounded(style.radius), - snap: true, + snap: style.snap, ..renderer::Quad::default() }, style.color, @@ -198,6 +198,8 @@ pub struct Style { pub radius: border::Radius, /// The [`FillMode`] of the rule. pub fill_mode: FillMode, + /// Whether the rule should be snapped to the pixel grid. + pub snap: bool, } /// The fill mode of a rule. @@ -302,5 +304,6 @@ pub fn default(theme: &Theme) -> Style { width: 1, radius: 0.0.into(), fill_mode: FillMode::Full, + snap: true, } }