INNER CODE UNIT · Rust

draw_path

plotters-rs/plotters · plotters-backend/src/lib.rs:163

    fn draw_path<S: BackendStyle, I: IntoIterator<Item = BackendCoord>>(
        &mut self,
        path: I,
        style: &S,
    ) -> Result<(), DrawingErrorKind<Self::ErrorType>> {
        if style.color().alpha == 0.0 {
            return Ok(());
        }

        if style.stroke_width() == 1 {
            let mut begin: Option<BackendCoord> = None;
            for end in path.into_iter() {
                if let Some(begin) = begin {
                    let result = self.draw_line(begin, end, style);
                    #[allow(clippy::question_mark)]
                    if result.is_err() {
                        return result;
                    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…