fn colored_points_inner<'ctxt, I>(
        self,
        ctxt: DrawingContext<'ctxt, S>,
        close: bool,
        points: I,
    ) -> Path<S>
    where
        S: BaseFloat,
        I: IntoIterator,
        I::Item: Into<ColoredPoint2<S>>,
        for<'a> PathGeometryBuilder<'a, 'ctxt, S>: GeometryBuilder<T::VertexInput>,
    {
        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));
            let p: geom::Point2 = p.cast().expect("failed to cast point");
            lyon::math::point(p.x, p.y)
        });
        let events = lyon::path::iterator::FromPolyline::new(close, iter).path_events();
        let stroke = &mut StrokeTessellator::default();
        let tessellators = Tessellators {
            fill: fill_tessellator,
            stroke,
        };
        let mut tessellator = T::tessellator(tessellators);
        let mut builder = mesh.builder();
        let res = self.opts.tessellate(
            &mut tessellator,
            events,
            &mut PathGeometryBuilder {
                builder: &mut builder,
                color: &color,
            },
        );
        if let Err(err) = res {
            eprintln!("failed to tessellate polyline: {:?}", err);
        }
        Path::new(
            self.position,
            self.orientation,
            self.color,
            builder.vertex_data_ranges(),
            builder.index_range(),
            builder.min_index(),
        )
    }
// Consumes an iterator of points and converts them to an iterator yielding events.
Consumes an iterator of points and converts them to an iterator yielding events.
Consumes an iterator of points and converts them to an iterator yielding events .
fn colored_points_inner<'ctxt, I>(
        self,
        ctxt: DrawingContext<'ctxt, S>,
        close: bool,
        points: I,
    ) -> Path<S>
    where
        S: BaseFloat,
        I: IntoIterator,
        I::Item: Into<ColoredPoint2<S>>,
        for<'a> PathGeometryBuilder<'a, 'ctxt, S>: GeometryBuilder<T::VertexInput>,
    {
        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));
            let p: geom::Point2 = p.cast().expect("failed to cast point");
            lyon::math::point(p.x, p.y)
        });
        let events = lyon::path::iterator::FromPolyline::new(close, iter).path_events();
        let stroke = &mut StrokeTessellator::default();
        let tessellators = Tessellators {
            fill: fill_tessellator,
            stroke,
        };
        let mut tessellator = T::tessellator(tessellators);
        let mut builder = mesh.builder();
        let res = self.opts.tessellate(
            &mut tessellator,
            events,
            &mut PathGeometryBuilder {
                builder: &mut builder,
                color: &color,
            },
        );
        if let Err(err) = res {
            eprintln!("failed to tessellate polyline: {:?}", err);
        }
        Path::new(
            self.position,
            self.orientation,
            self.color,
            builder.vertex_data_ranges(),
            builder.index_range(),
            builder.min_index(),
        )
    }
fn colored_points_inner < ' ctxt , I > ( self , ctxt : DrawingContext < ' ctxt , S > , close : bool , points : I , ) -> Path < S > where S : BaseFloat , I : IntoIterator , I :: Item : Into < ColoredPoint2 < S > > , for < ' a > PathGeometryBuilder < ' a , ' ctxt , S > : GeometryBuilder < T :: VertexInput > , { 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 ) ) ; let p : geom :: Point2 = p . cast ( ) . expect ( " " ) ; lyon :: math :: point ( p . x , p . y ) } ) ; let events = lyon :: path :: iterator :: FromPolyline :: new ( close , iter ) . path_events ( ) ; let stroke = & mut StrokeTessellator :: default ( ) ; let tessellators = Tessellators { fill : fill_tessellator , stroke , } ; let mut tessellator = T :: tessellator ( tessellators ) ; let mut builder = mesh . builder ( ) ; let res = self . opts . tessellate ( & mut tessellator , events , & mut PathGeometryBuilder { builder : & mut builder , color : & color , } , ) ; if let Err ( err ) = res { eprintln ! ( " " err ) ; } Path :: new ( self . position , self . orientation , self . color , builder . vertex_data_ranges ( ) , builder . index_range ( ) , builder . min_index ( ) , ) }
Consumes an iterator of points and converts them to an iterator yielding events.
Consumes an iterator of points and converts them to an iterator yielding events .
self
ctxt
DrawingContext<'ctxt, S>
close
bool
points
I
self
ctxt
DrawingContext<'ctxt, S>
close
bool
points
I