ignore re-calling fullScreen() if options unchanged

This commit is contained in:
Ben Fry
2015-06-07 23:04:05 -04:00
parent 0cfdc20fe7
commit bd66b3d5c2
2 changed files with 26 additions and 12 deletions

View File

@@ -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;
}
}
}

View File

@@ -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