diff options
author | 2019-11-24 11:34:30 +0100 | |
---|---|---|
committer | 2019-11-24 11:34:30 +0100 | |
commit | 149fd2aa1fa86858c7c1dcec8fd844caa78cec94 (patch) | |
tree | a199cf8d2caaf6aa60e48e93d6dd0688969d43b0 /wgpu/src/primitive.rs | |
parent | 9712b319bb7a32848001b96bd84977430f14b623 (diff) | |
parent | 47196c9007d12d3b3e0036ffabe3bf6d14ff4523 (diff) | |
download | iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.gz iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.bz2 iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.zip |
Merge pull request #65 from hecrj/improvement/docs
Documentation
Diffstat (limited to '')
-rw-r--r-- | wgpu/src/primitive.rs | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index b9f1ca6f..9efd74f6 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -1,32 +1,58 @@ -use iced_native::{text, Background, Color, Font, Rectangle, Vector}; +use iced_native::{ + Background, Color, Font, HorizontalAlignment, Rectangle, Vector, + VerticalAlignment, +}; +/// A rendering primitive. #[derive(Debug, Clone)] pub enum Primitive { + /// An empty primitive None, + /// A group of primitives Group { + /// The primitives of the group primitives: Vec<Primitive>, }, + /// A text primitive Text { + /// The contents of the text content: String, + /// The bounds of the text bounds: Rectangle, + /// The color of the text color: Color, + /// The size of the text size: f32, + /// The font of the text font: Font, - horizontal_alignment: text::HorizontalAlignment, - vertical_alignment: text::VerticalAlignment, + /// The horizontal alignment of the text + horizontal_alignment: HorizontalAlignment, + /// The vertical alignment of the text + vertical_alignment: VerticalAlignment, }, + /// A quad primitive Quad { + /// The bounds of the quad bounds: Rectangle, + /// The background of the quad background: Background, + /// The border radius of the quad border_radius: u16, }, + /// An image primitive Image { + /// The path of the image path: String, + /// The bounds of the image bounds: Rectangle, }, + /// A clip primitive Clip { + /// The bounds of the clip bounds: Rectangle, + /// The offset transformation of the clip offset: Vector<u32>, + /// The content of the clip content: Box<Primitive>, }, } |