File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
libs/soba/cameras/src/lib Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,15 @@ export class NgtsOrthographicCamera {
103103 constructor ( ) {
104104 extend ( { OrthographicCamera, Group } ) ;
105105
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+
106115 effect ( ( ) => {
107116 this . cameraRef ( ) . nativeElement . updateProjectionMatrix ( ) ;
108117 } ) ;
@@ -115,15 +124,6 @@ export class NgtsOrthographicCamera {
115124 camera . updateProjectionMatrix ( ) ;
116125 } ) ;
117126
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-
127127 let count = 0 ;
128128 let oldEnvMap : THREE . Color | THREE . Texture | null = null ;
129129 injectBeforeRender ( ( { gl, scene } ) => {
You can’t perform that action at this time.
0 commit comments