Skip to content

[tomo] Fix viscanvas's synchronizer

Thomas Vincent requested to merge fix-vis-sync into main

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 of react-three-fiber which actually does work in all cases when calling an invalidate from useFrame of another viscanvas. This implementation triggers the invalidate from useLayoutEffect 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

Merge request reports

Loading