File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,7 @@ static public class RendererChangeException extends RuntimeException { }
446
446
// https://github.com/processing/processing/issues/2297
447
447
int windowColor = 0xffDDDDDD ;
448
448
449
+ PStyle savedStyle ;
449
450
450
451
//////////////////////////////////////////////////////////////
451
452
//////////////////////////////////////////////////////////////
@@ -686,6 +687,14 @@ public void onResume() {
686
687
// surfaceView.onResume();
687
688
if (DEBUG ) System .out .println ("PApplet.onResume() called" );
688
689
paused = false ;
690
+
691
+ // TODO need to bring back app state here!
692
+ // At least we restore the current style.
693
+ if (savedStyle != null && g != null ) {
694
+ g .style (savedStyle );
695
+ savedStyle = null ;
696
+ }
697
+
689
698
handleMethods ("resume" );
690
699
//start(); // kick the thread back on
691
700
resume ();
@@ -699,7 +708,12 @@ public void onPause() {
699
708
setFullScreenVisibility ();
700
709
701
710
// TODO need to save all application state here!
702
- // System.out.println("PApplet.onPause() called");
711
+ // At least we save the current style.
712
+ if (g != null ) {
713
+ savedStyle = new PStyle ();
714
+ g .getStyle (savedStyle );
715
+ }
716
+
703
717
paused = true ;
704
718
handleMethods ("pause" );
705
719
pause (); // handler for others to write
You can’t perform that action at this time.
0 commit comments