From 80324284282f173e4d26e1f297daaf71a93f51a6 Mon Sep 17 00:00:00 2001 From: Malte Veerman Date: Fri, 6 Dec 2019 16:47:40 +0100 Subject: Implemented SVG support in iced_wgpu. --- wgpu/src/primitive.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'wgpu/src/primitive.rs') diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 04264e5d..c637626b 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -3,6 +3,8 @@ use iced_native::{ VerticalAlignment, }; +use crate::svg; + /// A rendering primitive. #[derive(Debug, Clone)] pub enum Primitive { @@ -46,6 +48,13 @@ pub enum Primitive { /// The bounds of the image bounds: Rectangle, }, + /// A svg icon primitive + Svg { + /// The handle of the icon + handle: svg::Handle, + /// The bounds of the icon + bounds: Rectangle, + }, /// A clip primitive Clip { /// The bounds of the clip -- cgit From a88aae5e04e0a92457e5dd617a86af823e90af6c Mon Sep 17 00:00:00 2001 From: Malte Veerman Date: Fri, 6 Dec 2019 19:37:56 +0100 Subject: Added an `Icon` widget to native. --- wgpu/src/primitive.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'wgpu/src/primitive.rs') diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index c637626b..1b0729cf 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -3,8 +3,6 @@ use iced_native::{ VerticalAlignment, }; -use crate::svg; - /// A rendering primitive. #[derive(Debug, Clone)] pub enum Primitive { @@ -50,8 +48,8 @@ pub enum Primitive { }, /// A svg icon primitive Svg { - /// The handle of the icon - handle: svg::Handle, + /// The path of the icon + handle: crate::svg::Handle, /// The bounds of the icon bounds: Rectangle, }, -- cgit From 895eaef99b52c24e6f3d804897ad850c1f1de960 Mon Sep 17 00:00:00 2001 From: Malte Veerman Date: Thu, 12 Dec 2019 01:14:54 +0100 Subject: Merged svg pipeline into image --- wgpu/src/primitive.rs | 7 ------- 1 file changed, 7 deletions(-) (limited to 'wgpu/src/primitive.rs') diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 1b0729cf..04264e5d 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -46,13 +46,6 @@ pub enum Primitive { /// The bounds of the image bounds: Rectangle, }, - /// A svg icon primitive - Svg { - /// The path of the icon - handle: crate::svg::Handle, - /// The bounds of the icon - bounds: Rectangle, - }, /// A clip primitive Clip { /// The bounds of the clip -- cgit From 09707f29fcf7fbd71570a43db214921043427c3f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 15 Dec 2019 06:19:07 +0100 Subject: Rerasterize SVGs when resized and refactor a bit --- wgpu/src/primitive.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'wgpu/src/primitive.rs') diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 04264e5d..958cc17f 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -1,6 +1,6 @@ use iced_native::{ - image, Background, Color, Font, HorizontalAlignment, Rectangle, Vector, - VerticalAlignment, + image, svg, Background, Color, Font, HorizontalAlignment, Rectangle, + Vector, VerticalAlignment, }; /// A rendering primitive. @@ -46,6 +46,14 @@ pub enum Primitive { /// The bounds of the image bounds: Rectangle, }, + /// An SVG primitive + Svg { + /// The path of the SVG file + handle: svg::Handle, + + /// The bounds of the viewport + bounds: Rectangle, + }, /// A clip primitive Clip { /// The bounds of the clip -- cgit