How to clear the old position circle path?


hey! I have a problem that if I want to move the position of a circle path the old position is always still here, my question is how to I remove the old position circle when I set a new position of a circle path. Thanks you for any help.
code just like that:
Path p1;
p1.addEllipse(0, 0, 100, 100);
g.fillPath(p1); //old position
p1.applyTransform(AffineTransform::translation(200, 200));
g.fillPath(p1); //new position


Read the docs!


You are filling the path two times, therefore the path is displayed two times :slight_smile:
During one paint call you can only paint one frame. So you want either draw only the old position or the new position. You can use e.g. a timer callback and call repaint() on your component, so it gets redrawn after that (async).