Merge pull request #2969 from iced-rs/feature/snapping-reloaded

Add `crisp` feature for default quad snapping
This commit is contained in:
Héctor 2025-05-30 03:06:33 +02:00 committed by GitHub
commit ca6d992d67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 184 additions and 138 deletions

View file

@ -75,6 +75,9 @@ pub struct Quad {
/// The [`Shadow`] of the [`Quad`].
pub shadow: Shadow,
/// Whether the [`Quad`] should be snapped to the pixel grid.
pub snap: bool,
}
impl Default for Quad {
@ -83,6 +86,7 @@ impl Default for Quad {
bounds: Rectangle::with_size(Size::ZERO),
border: Border::default(),
shadow: Shadow::default(),
snap: cfg!(feature = "crisp"),
}
}
}