Skip to content

Filling the same circle with a different color leaves an outline #211

Description

@euclio

With the following code:

use std::f32::consts::TAU;

use raqote::*;

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

    let black = SolidSource::from_unpremultiplied_argb(0xFF, 0x00, 0x00, 0x00);
    dt.clear(black);

    let mut pb = PathBuilder::new();
    pb.arc(200., 200., 100., 0., TAU);
    let path = pb.finish();

    dt.fill(
        &path,
        &Source::Solid(SolidSource::from_unpremultiplied_argb(0xFF, 0xFF, 0xFF, 0)),
        &DrawOptions::new(),
    );

    dt.fill(
        &path,
        &Source::Solid(black),
        &DrawOptions::new(),
    );

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

I would expect the result to be a completely black image.

However, a thin outline is left:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions