@@ -691,34 +691,30 @@ function interaction(p5, fn){
691
691
// p5._validateParameters('debugMode', args);
692
692
693
693
// start by removing existing 'post' registered debug methods
694
- for ( let i = this . _registeredMethods . post . length - 1 ; i >= 0 ; i -- ) {
694
+ for ( let i = p5 . lifecycleHooks . postdraw . length - 1 ; i >= 0 ; i -- ) {
695
695
// test for equality...
696
696
if (
697
- this . _registeredMethods . post [ i ] . toString ( ) === this . _grid ( ) . toString ( ) ||
698
- this . _registeredMethods . post [ i ] . toString ( ) === this . _axesIcon ( ) . toString ( )
697
+ p5 . lifecycleHooks . postdraw [ i ] . toString ( ) === this . _grid ( ) . toString ( ) ||
698
+ p5 . lifecycleHooks . postdraw [ i ] . toString ( ) === this . _axesIcon ( ) . toString ( )
699
699
) {
700
- this . _registeredMethods . post . splice ( i , 1 ) ;
700
+ p5 . lifecycleHooks . postdraw . splice ( i , 1 ) ;
701
701
}
702
702
}
703
703
704
704
// then add new debugMode functions according to the argument list
705
705
if ( args [ 0 ] === constants . GRID ) {
706
- this . registerMethod (
707
- 'post' ,
706
+ p5 . lifecycleHooks . postdraw . push (
708
707
this . _grid ( args [ 1 ] , args [ 2 ] , args [ 3 ] , args [ 4 ] , args [ 5 ] )
709
708
) ;
710
709
} else if ( args [ 0 ] === constants . AXES ) {
711
- this . registerMethod (
712
- 'post' ,
710
+ p5 . lifecycleHooks . postdraw . push (
713
711
this . _axesIcon ( args [ 1 ] , args [ 2 ] , args [ 3 ] , args [ 4 ] )
714
712
) ;
715
713
} else {
716
- this . registerMethod (
717
- 'post' ,
714
+ p5 . lifecycleHooks . postdraw . push (
718
715
this . _grid ( args [ 0 ] , args [ 1 ] , args [ 2 ] , args [ 3 ] , args [ 4 ] )
719
716
) ;
720
- this . registerMethod (
721
- 'post' ,
717
+ p5 . lifecycleHooks . postdraw . push (
722
718
this . _axesIcon ( args [ 5 ] , args [ 6 ] , args [ 7 ] , args [ 8 ] )
723
719
) ;
724
720
}
@@ -766,13 +762,13 @@ function interaction(p5, fn){
766
762
this . _assert3d ( 'noDebugMode' ) ;
767
763
768
764
// start by removing existing 'post' registered debug methods
769
- for ( let i = this . _registeredMethods . post . length - 1 ; i >= 0 ; i -- ) {
765
+ for ( let i = p5 . lifecycleHooks . postdraw . length - 1 ; i >= 0 ; i -- ) {
770
766
// test for equality...
771
767
if (
772
- this . _registeredMethods . post [ i ] . toString ( ) === this . _grid ( ) . toString ( ) ||
773
- this . _registeredMethods . post [ i ] . toString ( ) === this . _axesIcon ( ) . toString ( )
768
+ p5 . lifecycleHooks . postdraw [ i ] . toString ( ) === this . _grid ( ) . toString ( ) ||
769
+ p5 . lifecycleHooks . postdraw [ i ] . toString ( ) === this . _axesIcon ( ) . toString ( )
774
770
) {
775
- this . _registeredMethods . post . splice ( i , 1 ) ;
771
+ p5 . lifecycleHooks . postdraw . splice ( i , 1 ) ;
776
772
}
777
773
}
778
774
} ;
@@ -861,9 +857,9 @@ function interaction(p5, fn){
861
857
zOff = xOff ;
862
858
}
863
859
864
- return function ( ) {
860
+ return ( ) => {
865
861
this . push ( ) ;
866
- this . _renderer . states . setValue ( 'uModelMatrix' , this . states . uModelMatrix . clone ( ) ) ;
862
+ this . _renderer . states . setValue ( 'uModelMatrix' , this . _renderer . states . uModelMatrix . clone ( ) ) ;
867
863
this . _renderer . states . uModelMatrix . reset ( ) ;
868
864
869
865
// X axis
0 commit comments