summaryrefslogtreecommitdiffstats
path: root/core/src/length.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-04 13:00:16 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-04 18:39:31 +0200
commit9499a8f9e6f9971dedfae563cb133232aa3cebc2 (patch)
tree54074dd8b1fc17d63ad92d84b6d2b4415ad29df6 /core/src/length.rs
parent8e8808f0e187ed6671441f5016f07bfcba426452 (diff)
downloadiced-9499a8f9e6f9971dedfae563cb133232aa3cebc2.tar.gz
iced-9499a8f9e6f9971dedfae563cb133232aa3cebc2.tar.bz2
iced-9499a8f9e6f9971dedfae563cb133232aa3cebc2.zip
Support configurable `LineHeight` in text widgets
Diffstat (limited to 'core/src/length.rs')
-rw-r--r--core/src/length.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/length.rs b/core/src/length.rs
index bb925c4b..3adb996e 100644
--- a/core/src/length.rs
+++ b/core/src/length.rs
@@ -1,3 +1,5 @@
+use crate::Pixels;
+
/// The strategy used to fill space in a specific dimension.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Length {
@@ -36,6 +38,12 @@ impl Length {
}
}
+impl From<Pixels> for Length {
+ fn from(amount: Pixels) -> Self {
+ Length::Fixed(f32::from(amount))
+ }
+}
+
impl From<f32> for Length {
fn from(amount: f32) -> Self {
Length::Fixed(amount)