diff --git a/src/draw/drawing.rs b/src/draw/drawing.rs index 9a7ea11f1..faa098f31 100644 --- a/src/draw/drawing.rs +++ b/src/draw/drawing.rs @@ -48,7 +48,7 @@ pub struct DrawingContext<'a, S> { /// The intermediary mesh for buffering yet-to-be-drawn paths and meshes. pub mesh: &'a mut draw::IntermediaryMesh, /// A re-usable fill tessellator for 2D paths. - pub fill_tessellator: &'a mut FillTessellator + pub fill_tessellator: &'a mut FillTessellator, } /// Construct a new **Drawing** instance. diff --git a/src/draw/primitive/mod.rs b/src/draw/primitive/mod.rs index 3b0a25a4e..e9658ab03 100644 --- a/src/draw/primitive/mod.rs +++ b/src/draw/primitive/mod.rs @@ -12,7 +12,7 @@ use crate::geom; pub use self::ellipse::Ellipse; pub use self::line::Line; pub use self::mesh::Mesh; -pub use self::path::{Path, PathInit, PathFill, PathStroke}; +pub use self::path::{Path, PathFill, PathInit, PathStroke}; pub use self::polygon::Polygon; pub use self::quad::Quad; pub use self::rect::Rect; diff --git a/src/draw/primitive/path.rs b/src/draw/primitive/path.rs index c6119b78d..3a15da55b 100644 --- a/src/draw/primitive/path.rs +++ b/src/draw/primitive/path.rs @@ -297,11 +297,7 @@ impl PathStroke { } /// Submit path events as a polyline of colored points. - pub fn colored_points_closed( - self, - ctxt: DrawingContext, - points: I, - ) -> Path + pub fn colored_points_closed(self, ctxt: DrawingContext, points: I) -> Path where S: BaseFloat, I: IntoIterator, @@ -322,10 +318,16 @@ where I: IntoIterator, for<'a> PathGeometryBuilder<'a, 'ctxt, S>: GeometryBuilder, { - let DrawingContext { mesh, fill_tessellator } = ctxt; + let DrawingContext { + mesh, + fill_tessellator, + } = ctxt; let color = Cell::new(None); let stroke = &mut StrokeTessellator::default(); - let tessellators = Tessellators { fill: fill_tessellator, stroke }; + let tessellators = Tessellators { + fill: fill_tessellator, + stroke, + }; let mut tessellator = T::tessellator(tessellators); let mut builder = mesh.builder(); let res = self.opts.tessellate( @@ -356,11 +358,7 @@ where /// Consumes an iterator of points and converts them to an iterator yielding path events. /// /// Closes the start and end points. - pub fn points_closed<'ctxt, S, I>( - self, - ctxt: DrawingContext<'ctxt, S>, - points: I, - ) -> Path + pub fn points_closed<'ctxt, S, I>(self, ctxt: DrawingContext<'ctxt, S>, points: I) -> Path where S: BaseFloat, I: IntoIterator, @@ -383,7 +381,10 @@ where I::Item: Into>, for<'a> PathGeometryBuilder<'a, 'ctxt, S>: GeometryBuilder, { - let DrawingContext { mesh, fill_tessellator } = ctxt; + let DrawingContext { + mesh, + fill_tessellator, + } = ctxt; let color = Cell::new(None); let iter = points.into_iter().map(Into::into).map(|p| { let p: geom::Point2 = p.cast().expect("failed to cast point"); @@ -391,7 +392,10 @@ where }); let events = lyon::path::iterator::FromPolyline::new(close, iter).path_events(); let stroke = &mut StrokeTessellator::default(); - let tessellators = Tessellators { fill: fill_tessellator, stroke }; + let tessellators = Tessellators { + fill: fill_tessellator, + stroke, + }; let mut tessellator = T::tessellator(tessellators); let mut builder = mesh.builder(); let res = self.opts.tessellate( @@ -421,7 +425,10 @@ where I::Item: Into>, for<'a> PathGeometryBuilder<'a, 'ctxt, S>: GeometryBuilder, { - let DrawingContext { mesh, fill_tessellator } = ctxt; + let DrawingContext { + mesh, + fill_tessellator, + } = ctxt; let color = Cell::new(None); let iter = points.into_iter().map(Into::into).map(|p| { color.set(Some(p.color)); @@ -430,7 +437,10 @@ where }); let events = lyon::path::iterator::FromPolyline::new(close, iter).path_events(); let stroke = &mut StrokeTessellator::default(); - let tessellators = Tessellators { fill: fill_tessellator, stroke }; + let tessellators = Tessellators { + fill: fill_tessellator, + stroke, + }; let mut tessellator = T::tessellator(tessellators); let mut builder = mesh.builder(); let res = self.opts.tessellate( diff --git a/src/geom/vector.rs b/src/geom/vector.rs index 42f1b3626..92d874085 100644 --- a/src/geom/vector.rs +++ b/src/geom/vector.rs @@ -907,8 +907,8 @@ mod cgmath_impl { } mod lyon_impl { - use crate::math::Zero; use super::{Vector2, Vector3, Vector4}; + use crate::math::Zero; impl From for Vector2 where