summaryrefslogtreecommitdiffstats
path: root/wgpu/src/widget/canvas.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-12 07:08:49 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-12 07:08:49 +0100
commitf34407bfdaf06c4bf204dc31b152be9451c243b8 (patch)
treeaa9c48f24c9babb5722c2a7cdc098365b010796c /wgpu/src/widget/canvas.rs
parent74dd79e97f83d3e9e13d87444740edeb353f9be8 (diff)
downloadiced-f34407bfdaf06c4bf204dc31b152be9451c243b8.tar.gz
iced-f34407bfdaf06c4bf204dc31b152be9451c243b8.tar.bz2
iced-f34407bfdaf06c4bf204dc31b152be9451c243b8.zip
Implement `Frame::fill` and `Frame::stroke`
Diffstat (limited to '')
-rw-r--r--wgpu/src/widget/canvas.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/wgpu/src/widget/canvas.rs b/wgpu/src/widget/canvas.rs
index 7b84f36c..6bfeed9a 100644
--- a/wgpu/src/widget/canvas.rs
+++ b/wgpu/src/widget/canvas.rs
@@ -133,6 +133,16 @@ impl Default for LineCap {
}
}
+impl From<LineCap> for lyon::tessellation::LineCap {
+ fn from(line_cap: LineCap) -> lyon::tessellation::LineCap {
+ match line_cap {
+ LineCap::Butt => lyon::tessellation::LineCap::Butt,
+ LineCap::Square => lyon::tessellation::LineCap::Square,
+ LineCap::Round => lyon::tessellation::LineCap::Round,
+ }
+ }
+}
+
#[derive(Debug, Clone, Copy)]
pub enum LineJoin {
Miter,
@@ -146,6 +156,16 @@ impl Default for LineJoin {
}
}
+impl From<LineJoin> for lyon::tessellation::LineJoin {
+ fn from(line_join: LineJoin) -> lyon::tessellation::LineJoin {
+ match line_join {
+ LineJoin::Miter => lyon::tessellation::LineJoin::Miter,
+ LineJoin::Round => lyon::tessellation::LineJoin::Round,
+ LineJoin::Bevel => lyon::tessellation::LineJoin::Bevel,
+ }
+ }
+}
+
#[derive(Debug, Clone, Copy)]
pub enum Fill {
Color(Color),