chore(InteractorStyleMPRSlice): fix recursion error in example#3554
chore(InteractorStyleMPRSlice): fix recursion error in example#3554Jo-Byr wants to merge 1 commit into
Conversation
finetjul
left a comment
There was a problem hiding this comment.
It should be fixed in InteractorStyleMPRSlice instead of the example.
dd8aeba to
2ed5a8a
Compare
There was a problem hiding this comment.
I'm glad this fixes the example.
However, I think it does not fix the root of the problem.
The InteractorStyleMPRSlice is temporarilly notifying observers of an invalid "slice".
The problem is that it triggers a modify event between line 174 and line 175. When the state is unstable.
A proper fix should be to prevent such notification while the camera is being updated.
2ed5a8a to
2286a95
Compare
Limit slice widget update in example to prevent recursion error between the controller and interactor style
2286a95 to
476b547
Compare
I moved the first updateUI call and the istyle.onModified callback to after the first render call. |
While you may have fixed the example. You have not fixed all the consumers of InteractorStyleMPRSlice. It would be better to fix InteractorStyleMPRSlice in the first place (rather than the example (i.e. a consumer of InteractorStyleMPRSlice)). |
I did this too. The block In InteractorStyleMPRSlice's setSlice is responsible for that. The modification in the example is to fix this problem you mentioned:
|
Context
InteractorStyleMPRSlice example fails due to a recursion error.
Results
The error is fixed so the example works.
Changes
Added a difference threshold on the interactor Stume slice update to avoid recursion error
PR and Code Checklist
npm run reformatto have correctly formatted code