jrmuizel / raqote

Rust 2D graphics library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panics on an empty LinearGradient

RazrFalcon opened this issue · comments

use raqote::*;

fn main() {
    let mut dt = DrawTarget::new(400, 400);

    let mut pb = PathBuilder::new();
    pb.move_to(200., 200.);
    pb.line_to(300., 300.);
    pb.line_to(200., 300.);

    let path = pb.finish();

    let gradient = Source::LinearGradient(
        Gradient {
            stops: vec![],
        },
        Spread::Pad,
        Transform::default(),
    );
    dt.fill(&path, &gradient, &DrawOptions::new());

    dt.write_png("out.png").unwrap();
}

Panics at sw-composite-0.7.10/src/lib.rs:288