DropShadow::drawForPath always fill the Path

I try to use DropShadow::drawForPath(), and it works fine, but the problem is it is also fill whole path with selected colours. So after DropShadow::drawForPath() I always need to remember to fill the path with colour which I expect. Is it default behaviour? Or I do something wrong?

My code looks like that:

    Path path;
    path.addPolygon({0.0f, 0.0f}, 6, 20.0f);
    DropShadow ds(Colours::red, 10,{0,0});
    ds.drawForPath(g, path);

And with that I receive red polygon with red outer shadow.

For any help thanks in advance.
Best Regards

I’m not looking at the code, but that sounds like it’s expected behavior. It would be a waste of processing to try to subtract the path itself from the DropShadow (making the path part transparent), when most people will fill the path with some other color anyway. You can just fill the path with the color you want, after drawing the DropShadow.

1 Like