diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 29f0ca8f2..4ae40400b 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -1445,10 +1445,18 @@ public class PApplet extends Applet // make sure the screen is visible and usable // (also prevents over-drawing when using PGraphicsOpenGL) - if ((g != null) && (g.image != null)) { -// println("inside paint(), screen.drawImage()"); - screen.drawImage(g.image, 0, 0, null); + if (g != null) { + // added synchronization for 0194 because of flicker issues with JAVA2D + // + synchronized (g) { + if (g.image != null) { + screen.drawImage(g.image, 0, 0, null); + } + } } +// if ((g != null) && (g.image != null)) { +// screen.drawImage(g.image, 0, 0, null); +// } } @@ -1565,6 +1573,7 @@ public class PApplet extends Applet //System.out.println("handleDraw() " + frameCount); + synchronized (g) { g.beginDraw(); if (recorder != null) { recorder.beginDraw(); @@ -1620,12 +1629,14 @@ public class PApplet extends Applet } g.endDraw(); + if (recorder != null) { recorder.endDraw(); } frameRateLastNanos = now; frameCount++; + } repaint(); getToolkit().sync(); // force repaint now (proper method) diff --git a/core/todo.txt b/core/todo.txt index 40ab1c413..0dd7baa29 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,6 @@ 0194 core +X flicker between background and rest with JAVA2D +X http://code.google.com/p/processing/issues/detail?id=558 _ bug: textAlign(RIGHT) is shutting off native fonts