Skip to content

Commit 62bfa77

Browse files
committed
dont save/restore style when sketch pauses/resumes
1 parent 074f571 commit 62bfa77

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

core/src/processing/core/PApplet.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ public class PApplet extends Object implements ActivityAPI, PConstants {
338338
// https://github.com/processing/processing/issues/2297
339339
int windowColor = 0xffDDDDDD;
340340

341-
PStyle savedStyle;
342-
343341
///////////////////////////////////////////////////////////////
344342
// Error messages
345343

@@ -535,12 +533,8 @@ public void onResume() {
535533
setFullScreenVisibility();
536534
}
537535

538-
// TODO need to bring back app state here!
539-
// At least we restore the current style.
540-
if (savedStyle != null && g != null) {
536+
if (g != null) {
541537
g.restoreState();
542-
g.style(savedStyle);
543-
savedStyle = null;
544538
}
545539

546540
handleMethods("resume");
@@ -566,12 +560,7 @@ public void onPause() {
566560
// Make sure that the keyboard is not left open after leaving the app
567561
closeKeyboard();
568562

569-
// TODO need to save all application state here!
570-
// At least we save the current style (once we had at least drawn one
571-
// frame, otherwise we might be saving a "null" style with all zeroes).
572-
if (g != null && 0 < frameCount) {
573-
savedStyle = new PStyle();
574-
g.getStyle(savedStyle);
563+
if (g != null) {
575564
g.saveState();
576565
}
577566

0 commit comments

Comments
 (0)