diff options
author | 2021-09-20 15:09:55 +0700 | |
---|---|---|
committer | 2021-09-20 15:14:08 +0700 | |
commit | a0ad3996225601aaa1ebe051cba115374b55c80e (patch) | |
tree | 8420a91cd319a63b1ed257a6334453a1a673bdfb /graphics/src/widget/canvas/text.rs | |
parent | 5fae6e59ffbc5913761df638dc7f0c35b7f43bc9 (diff) | |
download | iced-a0ad3996225601aaa1ebe051cba115374b55c80e.tar.gz iced-a0ad3996225601aaa1ebe051cba115374b55c80e.tar.bz2 iced-a0ad3996225601aaa1ebe051cba115374b55c80e.zip |
Refactor alignment types into an `alignment` module
Diffstat (limited to 'graphics/src/widget/canvas/text.rs')
-rw-r--r-- | graphics/src/widget/canvas/text.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/graphics/src/widget/canvas/text.rs b/graphics/src/widget/canvas/text.rs index c4cae30e..ab070a70 100644 --- a/graphics/src/widget/canvas/text.rs +++ b/graphics/src/widget/canvas/text.rs @@ -1,4 +1,5 @@ -use iced_native::{Color, Font, HorizontalAlignment, Point, VerticalAlignment}; +use crate::alignment; +use crate::{Color, Font, Point}; /// A bunch of text that can be drawn to a canvas #[derive(Debug, Clone)] @@ -14,9 +15,9 @@ pub struct Text { /// The font of the text pub font: Font, /// The horizontal alignment of the text - pub horizontal_alignment: HorizontalAlignment, + pub horizontal_alignment: alignment::Horizontal, /// The vertical alignment of the text - pub vertical_alignment: VerticalAlignment, + pub vertical_alignment: alignment::Vertical, } impl Default for Text { @@ -27,8 +28,8 @@ impl Default for Text { color: Color::BLACK, size: 16.0, font: Font::Default, - horizontal_alignment: HorizontalAlignment::Left, - vertical_alignment: VerticalAlignment::Top, + horizontal_alignment: alignment::Horizontal::Left, + vertical_alignment: alignment::Vertical::Top, } } } |