[tomo] Fix viscanvas's synchronizer
Closes daiquiri-tomo#244 (closed)
This MR fixes issues in the VisSynchroniser
component in 2 ways:
- It changes the way to compute the threshold to skip some
updateCameraViewpoint
: The previous one was buggy when e.g., zooming-in a lot. - It changes the way to trigger a rendering of the other viscanvas. The previous approach calling
invalidate
directly had an issue due to the implementation ofreact-three-fiber
which actually does work in all cases when calling aninvalidate
fromuseFrame
of another viscanvas. This implementation triggers theinvalidate
fromuseLayoutEffect
through a state update.
It updates react-hookz
dependency to v22.0.0 to use useCounter
(Note: this dependency didn't looked to be used at all in the project).
It also addresses comment !547 (comment 232498) that was left from MR !547 (merged).
Thanks again @bocciare for the help in the investigation/fix!
attn @valentin.valls
closes daiquiri-tomo#244 (closed)
Edited by Valentin Valls