File tree 1 file changed +9
-9
lines changed
libs/soba/cameras/src/lib
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,15 @@ export class NgtsOrthographicCamera {
103
103
constructor ( ) {
104
104
extend ( { OrthographicCamera, Group } ) ;
105
105
106
+ effect ( ( onCleanup ) => {
107
+ const makeDefault = this . makeDefault ( ) ;
108
+ if ( ! makeDefault ) return ;
109
+
110
+ const oldCam = this . store . snapshot . camera ;
111
+ this . store . update ( { camera : this . cameraRef ( ) . nativeElement } ) ;
112
+ onCleanup ( ( ) => this . store . update ( ( ) => ( { camera : oldCam } ) ) ) ;
113
+ } ) ;
114
+
106
115
effect ( ( ) => {
107
116
this . cameraRef ( ) . nativeElement . updateProjectionMatrix ( ) ;
108
117
} ) ;
@@ -115,15 +124,6 @@ export class NgtsOrthographicCamera {
115
124
camera . updateProjectionMatrix ( ) ;
116
125
} ) ;
117
126
118
- effect ( ( onCleanup ) => {
119
- const makeDefault = this . makeDefault ( ) ;
120
- if ( ! makeDefault ) return ;
121
-
122
- const oldCam = this . store . snapshot . camera ;
123
- this . store . update ( { camera : this . cameraRef ( ) . nativeElement } ) ;
124
- onCleanup ( ( ) => this . store . update ( ( ) => ( { camera : oldCam } ) ) ) ;
125
- } ) ;
126
-
127
127
let count = 0 ;
128
128
let oldEnvMap : THREE . Color | THREE . Texture | null = null ;
129
129
injectBeforeRender ( ( { gl, scene } ) => {
You can’t perform that action at this time.
0 commit comments