From bd66b3d5c2d4de2e76cc7b1579bfbe12eb21ff03 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 7 Jun 2015 23:04:05 -0400 Subject: [PATCH] ignore re-calling fullScreen() if options unchanged --- core/src/processing/core/PApplet.java | 36 ++++++++++++++++++--------- core/todo.txt | 2 ++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 1f0e648db..30ae50998 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -39,6 +39,7 @@ import java.awt.Toolkit; import java.awt.color.ColorSpace; import java.awt.image.BufferedImage; + // used by loadImage() functions import javax.imageio.ImageIO; import javax.swing.ImageIcon; @@ -1572,16 +1573,20 @@ public class PApplet implements PConstants { * Create a full-screen sketch using the default renderer. */ public void fullScreen() { - if (insideSettings("fullScreen")) { - this.fullScreen = true; + if (!fullScreen) { + if (insideSettings("fullScreen")) { + this.fullScreen = true; + } } } public void fullScreen(int display) { - if (insideSettings("fullScreen", display)) { - this.fullScreen = true; - this.display = display; + if (!fullScreen || display != this.display) { + if (insideSettings("fullScreen", display)) { + this.fullScreen = true; + this.display = display; + } } } @@ -1600,9 +1605,12 @@ public class PApplet implements PConstants { * @see PApplet#smooth() */ public void fullScreen(String renderer) { - if (insideSettings("fullScreen", renderer)) { - this.fullScreen = true; - this.renderer = renderer; + if (!fullScreen || + !renderer.equals(this.renderer)) { + if (insideSettings("fullScreen", renderer)) { + this.fullScreen = true; + this.renderer = renderer; + } } } @@ -1611,10 +1619,14 @@ public class PApplet implements PConstants { * @param display the screen to run the sketch on (1, 2, 3, etc.) */ public void fullScreen(String renderer, int display) { - if (insideSettings("fullScreen", renderer, display)) { - this.fullScreen = true; - this.renderer = renderer; - this.display = display; + if (!fullScreen || + !renderer.equals(this.renderer) || + display != this.display) { + if (insideSettings("fullScreen", renderer, display)) { + this.fullScreen = true; + this.renderer = renderer; + this.display = display; + } } } diff --git a/core/todo.txt b/core/todo.txt index 306aff388..e6035f842 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -77,6 +77,8 @@ _ surface.size(), surface.noSmooth()... just like PGraphics methods? X sketchXxxx() methods _ make final to move folks away from these? _ or is this a bad move until we've sorted out Android? +_ _2X last call +_ https://github.com/processing/processing/issues/3361 critical