diff options
author | 2020-05-28 21:52:34 +0200 | |
---|---|---|
committer | 2020-05-28 21:52:34 +0200 | |
commit | d3db055583f4cbef1441fd66d07da70424bd1200 (patch) | |
tree | 9f695bd26f688a5aaf3b8fa687a0e3ff096ffe11 /wgpu/src/widget/canvas/text.rs | |
parent | ead4186870d1b46015986f702dd63382498060fc (diff) | |
parent | 709ed1f3f7ad8cf67a176763e394aaae4e808e93 (diff) | |
download | iced-d3db055583f4cbef1441fd66d07da70424bd1200.tar.gz iced-d3db055583f4cbef1441fd66d07da70424bd1200.tar.bz2 iced-d3db055583f4cbef1441fd66d07da70424bd1200.zip |
Merge pull request #354 from hecrj/feature/glow-renderer
OpenGL renderer and backend-agnostic graphics subcrate
Diffstat (limited to 'wgpu/src/widget/canvas/text.rs')
-rw-r--r-- | wgpu/src/widget/canvas/text.rs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/wgpu/src/widget/canvas/text.rs b/wgpu/src/widget/canvas/text.rs deleted file mode 100644 index c4cae30e..00000000 --- a/wgpu/src/widget/canvas/text.rs +++ /dev/null @@ -1,49 +0,0 @@ -use iced_native::{Color, Font, HorizontalAlignment, Point, VerticalAlignment}; - -/// A bunch of text that can be drawn to a canvas -#[derive(Debug, Clone)] -pub struct Text { - /// The contents of the text - pub content: String, - /// The position where to begin drawing the text (top-left corner coordinates) - pub position: Point, - /// The color of the text - pub color: Color, - /// The size of the text - pub size: f32, - /// The font of the text - pub font: Font, - /// The horizontal alignment of the text - pub horizontal_alignment: HorizontalAlignment, - /// 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, - } - } -} - -impl From<String> for Text { - fn from(content: String) -> Text { - Text { - content, - ..Default::default() - } - } -} - -impl From<&str> for Text { - fn from(content: &str) -> Text { - String::from(content).into() - } -} |