-
Notifications
You must be signed in to change notification settings - Fork 32
fix updating nodes during update loop #687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Fixes #670 |
|
There's an issue with this fix as it does not go through the vrt till the end. |
wouterlucas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is your initial creation out of bounds and is it not being processed correctly before you put it on screen?
| updateType &= ~UpdateType.RenderBounds; // remove render bounds update | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing this? This will force part of the tree that are out of bounds to continue to be processed, which essentially is wasteful as those parts aren't visible (hence take performance).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snippit makes lines 1271 unreachable. TS warns about it you're just using this.renderState rather than renderState. This prevents nodes from updating that were out of bounds and coming into bounds.
|
|
||
| // reset update type | ||
| this.updateType = 0; | ||
| this.childUpdateType = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this help exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #670
Resetting update type should be done at top of the loop as nodes can change values during the render cycle and can be redrawn on the next frame.