File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff 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();
You can’t perform that action at this time.
0 commit comments