We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello Together,
we have a problem again. We are drawing a bunch of circles. In the middle of one of these drawingCountry Methods it suddenly doesn't draw circles anymore. Also following drawingCountry Methods don't draw circles anymore, but they still get called. We tested it by inserting println("test"). Does anyone have an idea why this happens?
Our code looks similar to this:
public void drawRussia() {
canvas.ellipseMode(CORNER);
canvas.ellipse(705*factorWidth, 149*factorHeight, 75, 75);
canvas.ellipse(629.5*factorWidth, 161.5*factorHeight, 75, 75);
canvas.ellipse(523*factorWidth, 164*factorHeight, 75, 75);
canvas.ellipse(562*factorWidth, 244*factorHeight, 10, 10);
canvas.ellipse(555*factorWidth, 253*factorHeight, 10, 10);
//--------------------------stops drawing circles -------------------
canvas.ellipse(720*factorWidth, 223*factorHeight, 15, 15);
canvas.ellipse(673*factorWidth, 116*factorHeight, 50, 50);
canvas.ellipse(777*factorWidth, 121*factorHeight, 75, 75);
}
After drawRussia(), there are similar methods following (which don't draw). Before everything works well.
Is there some kind of buffer, or limit in drawing ...
Thanks for your help.
Answers
When I tried it using 0.5 - 1.1 for the factors it drew all 8 ellipses so I don't see what the problem is.
There is always the risk of larger circles covering smaller circles so it looks like the smaller ones have not been draw. I suggest that you draw the circles in order from largest to smallest to avoid this possibility.
This is not our problem because we can see an empty space where a circle should be drawn (for example in russia):
Is canvas an off-screen PGraphics object?
What mode are you using?
Yes, it is a PGraphics object. What exactly do you mean by mode? ellipseMode(CORNER)?
mode as in java / js / android....?
either you have a fill color like your background or the ellipse is way too small
or it is behind other bigger ellipses (draw bigger ones before drawing smaller ones...)
Our mode is java.
We just tried a lot of different things and now we solved our problem: there is a canvas.beginDraw() in setup() but the canvas.endDraw() is in the draw(). And now we realized that there has to be a canvas.endDraw() in setup() as well and a canvas.beginDraw() in draw(). This is what caused errors in our whole code....
Anyway thanks for your help guys!!
great!
Crossposted: http://stackoverflow.com/questions/27227278/processing-method-stops-drawing-circles