From 65eb218d3d7ba52b2869a586a1480eeb3c8f84e4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 21 Nov 2019 13:47:20 +0100 Subject: Move widgets from `core` to `native` and `web` Also made fields private and improved `Renderer` traits. --- wgpu/src/primitive.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'wgpu/src/primitive.rs') diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index b9f1ca6f..564dbda4 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -1,4 +1,7 @@ -use iced_native::{text, Background, Color, Font, Rectangle, Vector}; +use iced_native::{ + Background, Color, Font, HorizontalAlignment, Rectangle, Vector, + VerticalAlignment, +}; #[derive(Debug, Clone)] pub enum Primitive { @@ -12,8 +15,8 @@ pub enum Primitive { color: Color, size: f32, font: Font, - horizontal_alignment: text::HorizontalAlignment, - vertical_alignment: text::VerticalAlignment, + horizontal_alignment: HorizontalAlignment, + vertical_alignment: VerticalAlignment, }, Quad { bounds: Rectangle, -- cgit From 6a0e442ad68c2b104b7e91ef80798610a79aca6b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 22 Nov 2019 22:14:24 +0100 Subject: Write docs for `iced_wgpu` --- wgpu/src/primitive.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'wgpu/src/primitive.rs') diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 564dbda4..9efd74f6 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -3,33 +3,56 @@ use iced_native::{ 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, }, + /// 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, + /// 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, + /// The content of the clip content: Box, }, } -- cgit