Skip to content

Commit f0aaa83

Browse files
committed
let's get away from that repaint() thing, shall we?
1 parent 38202f1 commit f0aaa83

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/processing/core/PSurfaceAWT.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,18 @@ protected synchronized void render() {
278278
// not sure why this was here, can't be good
279279
//canvas.setBounds(0, 0, sketch.width, sketch.height);
280280

281+
if (!canvas.isDisplayable()) {
282+
// System.out.println("no peer.. holding");
283+
return;
284+
}
285+
281286
// System.out.println("render(), canvas bounds are " + canvas.getBounds());
282287
if (canvas.getBufferStrategy() == null) { // whole block [121222]
283288
// System.out.println("creating a strategy");
284289
canvas.createBufferStrategy(2);
285290
}
286291
BufferStrategy strategy = canvas.getBufferStrategy();
292+
// System.out.println(strategy);
287293
if (strategy == null) {
288294
return;
289295
}
@@ -367,7 +373,9 @@ public void paint(Graphics screen) {
367373

368374

369375
public void blit() {
370-
canvas.repaint();
376+
// System.out.println("blit");
377+
((SmoothCanvas) canvas).render(); // ??
378+
// canvas.repaint();
371379
/*
372380
if (canvas.getGraphicsConfiguration() != null) {
373381
GraphicsDevice device = canvas.getGraphicsConfiguration().getDevice();

0 commit comments

Comments
 (0)