Make Frame::stroke take a generic Into<Stroke>

This commit is contained in:
Héctor Ramón Jiménez 2020-04-14 06:39:47 +02:00
parent 81096ef454
commit dce1034699

View File

@ -127,11 +127,13 @@ impl Frame {
/// ///
/// [`Path`]: path/struct.Path.html /// [`Path`]: path/struct.Path.html
/// [`Frame`]: struct.Frame.html /// [`Frame`]: struct.Frame.html
pub fn stroke(&mut self, path: &Path, stroke: Stroke) { pub fn stroke(&mut self, path: &Path, stroke: impl Into<Stroke>) {
use lyon::tessellation::{ use lyon::tessellation::{
BuffersBuilder, StrokeOptions, StrokeTessellator, BuffersBuilder, StrokeOptions, StrokeTessellator,
}; };
let stroke = stroke.into();
let mut buffers = BuffersBuilder::new( let mut buffers = BuffersBuilder::new(
&mut self.buffers, &mut self.buffers,
StrokeVertex(stroke.color.into_linear()), StrokeVertex(stroke.color.into_linear()),