diff options
author | 2020-04-14 06:37:27 +0200 | |
---|---|---|
committer | 2020-04-14 06:37:27 +0200 | |
commit | 2a795faf4e3357397298d0c64dcc2c56169906b8 (patch) | |
tree | 159dacddcce1677564aa19edbbf57234b03d1aca /wgpu | |
parent | ce65097834cf5a36bb528a371339b2ff2720dd61 (diff) | |
download | iced-2a795faf4e3357397298d0c64dcc2c56169906b8.tar.gz iced-2a795faf4e3357397298d0c64dcc2c56169906b8.tar.bz2 iced-2a795faf4e3357397298d0c64dcc2c56169906b8.zip |
Make `Frame::fill` take a generic `Into<Fill>`
This can be used to improve readability by using your own types.
Diffstat (limited to 'wgpu')
-rw-r--r-- | wgpu/src/widget/canvas/frame.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wgpu/src/widget/canvas/frame.rs b/wgpu/src/widget/canvas/frame.rs index 940be402..f04c6e78 100644 --- a/wgpu/src/widget/canvas/frame.rs +++ b/wgpu/src/widget/canvas/frame.rs @@ -89,14 +89,14 @@ impl Frame { /// /// [`Path`]: path/struct.Path.html /// [`Frame`]: struct.Frame.html - pub fn fill(&mut self, path: &Path, fill: Fill) { + pub fn fill(&mut self, path: &Path, fill: impl Into<Fill>) { use lyon::tessellation::{ BuffersBuilder, FillOptions, FillTessellator, }; let mut buffers = BuffersBuilder::new( &mut self.buffers, - FillVertex(match fill { + FillVertex(match fill.into() { Fill::Color(color) => color.into_linear(), }), ); |