(fix) Prevent maximum call stack exceeded error when jumping to measurement with crosshair enabled #2519
+17
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
During measurement navigation, the following sequence occurs:
setViewReferenceinvokessetOrientationsetOrientationcallsapplyViewOrientationapplyViewOrientationtriggersresetCamerawith{ resetOrientation: false, resetRotation: false }resetCameraemits aCAMERA_RESETeventCAMERA_RESETby resetting the camera again withresetRotation: trueAfter applying the orientation,
setViewReferencecontinues under the assumption that the viewport is aligned with the measurement’s orientation. However, the repeated camera resets triggered by the crosshair revert the orientation. This causessetViewReferenceto continuously reapply the orientation, resulting in an infinite loop and eventually a maximum call stack exceeded error.maxium_call_stack_error.mp4
Changes & Results
Camera reset events are now suppressed while applying orientation changes during measurement navigation, preventing recursive resets and eliminating the call stack overflow.
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment