3
« on: September 28, 2012, 04:04:48 pm »
As Nexus stated, don't create a massive list of circles. It's inefficient and can be done much better.
The easy way to do it is to have a single circle object that can be resized and recolored as needed. Then when the user clicks, you set the center of the circle to the position of the mouse and then draw the circle for as long as the user clicks. When the user stops clicking, you can move it to a position off-screen and then stop calling the draw command on it.
Don't call clear(), this will keep the drawn image on the screen instead of having to draw a bunch of circles. You can implement an interface that the user can use to change colors/brushes but make sure it gets drawn over the drawing space. Alternatively you can place it in a separate window.