diff options
author | 2024-07-21 20:00:02 +0200 | |
---|---|---|
committer | 2024-07-21 20:00:02 +0200 | |
commit | 65b525af7ff2823cfe635c4b26d33aad9068e392 (patch) | |
tree | dbd792192e3cdc90a46c822b73287c1828380eeb /core | |
parent | f830454ffad1cf60f1d6e56fe95514af96848a64 (diff) | |
download | iced-65b525af7ff2823cfe635c4b26d33aad9068e392.tar.gz iced-65b525af7ff2823cfe635c4b26d33aad9068e392.tar.bz2 iced-65b525af7ff2823cfe635c4b26d33aad9068e392.zip |
Introduce `markdown::Settings`
Diffstat (limited to '')
-rw-r--r-- | core/src/pixels.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/src/pixels.rs b/core/src/pixels.rs index f5550a10..a1ea0f15 100644 --- a/core/src/pixels.rs +++ b/core/src/pixels.rs @@ -9,6 +9,11 @@ #[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Default)] pub struct Pixels(pub f32); +impl Pixels { + /// Zero pixels. + pub const ZERO: Self = Self(0.0); +} + impl From<f32> for Pixels { fn from(amount: f32) -> Self { Self(amount) @@ -58,3 +63,19 @@ impl std::ops::Mul<f32> for Pixels { Pixels(self.0 * rhs) } } + +impl std::ops::Div for Pixels { + type Output = Pixels; + + fn div(self, rhs: Self) -> Self { + Pixels(self.0 / rhs.0) + } +} + +impl std::ops::Div<f32> for Pixels { + type Output = Pixels; + + fn div(self, rhs: f32) -> Self { + Pixels(self.0 / rhs) + } +} |