Great thanks, but all of that just don’t work for me. I don’t want to use
Rectangle, It was just example.
I want to receive something like I showed on pictures. You’ve told to use
Graphics:: reduceClipRegion() with path, but I can’t find the way how to use it.
My code is like that:
void MyComponent::paint(Graphics& g)
float width = getWidth(); // Which is 100
float height = getHeight(); // Which is 100
path.addEllipse((width/2) - 20.0f, (height/2) - 20.0f, 40.0f, 40.0f);
So here I expect to have big red square (100x100), which is totally transparent in a circle in the center of square, and the circle radius is 20.
g.reduceClipRegion(path); does nothing. It doesn’t matter if I use it or I delete it I still have square which is fully filled with red colour.