Make Frame::fill
take a generic Into<Fill>
This can be used to improve readability by using your own types.
This commit is contained in:
parent
ce65097834
commit
2a795faf4e
@ -89,14 +89,14 @@ impl Frame {
|
|||||||
///
|
///
|
||||||
/// [`Path`]: path/struct.Path.html
|
/// [`Path`]: path/struct.Path.html
|
||||||
/// [`Frame`]: struct.Frame.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::{
|
use lyon::tessellation::{
|
||||||
BuffersBuilder, FillOptions, FillTessellator,
|
BuffersBuilder, FillOptions, FillTessellator,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut buffers = BuffersBuilder::new(
|
let mut buffers = BuffersBuilder::new(
|
||||||
&mut self.buffers,
|
&mut self.buffers,
|
||||||
FillVertex(match fill {
|
FillVertex(match fill.into() {
|
||||||
Fill::Color(color) => color.into_linear(),
|
Fill::Color(color) => color.into_linear(),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user