diff options
author | 2020-03-08 00:06:48 +0100 | |
---|---|---|
committer | 2020-03-08 00:06:48 +0100 | |
commit | b4f970ee7317297615848cd12f422c0cd2889f60 (patch) | |
tree | 13d58d144c3ddf05e44c72557bf2af2194207bf3 | |
parent | e9194cbf4a95ad743e16864f949716701d984a0d (diff) | |
download | iced-b4f970ee7317297615848cd12f422c0cd2889f60.tar.gz iced-b4f970ee7317297615848cd12f422c0cd2889f60.tar.bz2 iced-b4f970ee7317297615848cd12f422c0cd2889f60.zip |
Implement `Default` for `canvas::Text`
-rw-r--r-- | wgpu/src/widget/canvas/text.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wgpu/src/widget/canvas/text.rs b/wgpu/src/widget/canvas/text.rs index 1f9bdc19..d1cf1a0f 100644 --- a/wgpu/src/widget/canvas/text.rs +++ b/wgpu/src/widget/canvas/text.rs @@ -18,3 +18,17 @@ pub struct Text { /// The vertical alignment of the text pub vertical_alignment: VerticalAlignment, } + +impl Default for Text { + fn default() -> Text { + Text { + content: String::new(), + position: Point::ORIGIN, + color: Color::BLACK, + size: 16.0, + font: Font::Default, + horizontal_alignment: HorizontalAlignment::Left, + vertical_alignment: VerticalAlignment::Top, + } + } +} |