File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,7 @@ public class PApplet extends Object implements PConstants {
466
466
// https://github.com/processing/processing/issues/2297
467
467
int windowColor = 0xffDDDDDD ;
468
468
469
+ PStyle savedStyle ;
469
470
470
471
//////////////////////////////////////////////////////////////
471
472
//////////////////////////////////////////////////////////////
@@ -574,20 +575,33 @@ private void setFullScreenVisibility() {
574
575
575
576
576
577
public void onResume () {
577
- // TODO need to bring back app state here!
578
578
if (DEBUG ) System .out .println ("PApplet.onResume() called" );
579
579
if (parentLayout == -1 ) {
580
580
setFullScreenVisibility ();
581
581
}
582
+
583
+ // TODO need to bring back app state here!
584
+ // At least we restore the current style.
585
+ if (savedStyle != null ) {
586
+ g .style (savedStyle );
587
+ savedStyle = null ;
588
+ }
589
+
582
590
handleMethods ("resume" );
591
+
583
592
surface .resumeThread ();
584
593
resume ();
585
594
}
586
595
587
596
588
597
public void onPause () {
589
598
// TODO need to save all application state here!
599
+ // At least we save the current style.
600
+ savedStyle = new PStyle ();
601
+ g .getStyle (savedStyle );
602
+
590
603
handleMethods ("pause" );
604
+
591
605
surface .pauseThread ();
592
606
pause (); // handler for others to write
593
607
}
You can’t perform that action at this time.
0 commit comments