File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -262,9 +262,10 @@ export class NgtCanvas implements OnInit, OnChanges {
262262 this . zone . runOutsideAngular ( ( ) => {
263263 if ( ! this . configurator ) this . configurator = this . initRoot ( this . glCanvas . nativeElement ) ;
264264 this . configurator . configure ( { ...inputs ( ) , size : result } ) ;
265+ this . configurator . startInvalidate ( ) ;
265266
266267 if ( this . glRef ) {
267- this . cdr . detectChanges ( ) ;
268+ safeDetectChanges ( this . cdr ) ;
268269 } else {
269270 this . render ( ) ;
270271 }
@@ -346,7 +347,7 @@ export class NgtCanvas implements OnInit, OnChanges {
346347 for ( const [ key , value ] of Object . entries ( this . sceneGraphInputs ) ) {
347348 this . glRef . setInput ( key , value ) ;
348349 }
349- this . glRef . changeDetectorRef . detectChanges ( ) ;
350+ safeDetectChanges ( this . glRef . changeDetectorRef ) ;
350351 }
351352 } ) ;
352353 }
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ export class NgtRendererStore {
236236 return ;
237237 }
238238
239- const parent = getLocalState ( node ) . parent ( ) || rS [ NgtRendererClassId . parent ] ;
239+ const parent = untracked ( getLocalState ( node ) . parent ) || rS [ NgtRendererClassId . parent ] ;
240240
241241 // [rawValue]
242242 if ( getLocalState ( node ) . isRaw && name === SPECIAL_PROPERTIES . VALUE ) {
Original file line number Diff line number Diff line change @@ -261,9 +261,13 @@ export function injectCanvasRootInitializer(injector?: Injector) {
261261 if ( state . frameloop !== frameloop ) state . setFrameloop ( frameloop ) ;
262262
263263 isConfigured = true ;
264-
264+ } ,
265+ startInvalidate : ( ) => {
265266 invalidateRef ?. destroy ( ) ;
266- invalidateRef = effect ( ( ) => void store . state ( ) . invalidate ( ) , { manualCleanup : true , injector } ) ;
267+ return ( invalidateRef = effect ( ( ) => void store . state ( ) . invalidate ( ) , {
268+ manualCleanup : true ,
269+ injector,
270+ } ) ) ;
267271 } ,
268272 } ;
269273 } ;
You can’t perform that action at this time.
0 commit comments