[tomo] Fix h5web's SelectionRect performance issue on chrome
This MR workaround two issues with chrome when zooming in with a SelectionRect
with dashed strokes:
- In this case, the more you zoom-in (and so the more the
SelectionRect
is big around the canvas), the worst performances are...Firefox is less affected by this. Also it is only with dashed strokes. - Also when zooming-in a lot on a line, it's rendering becomes weird and the line might even disappear...
This MR mitigates both issues by clamping the SVG rect to a rect slightly bigger than the canvas size (so the stroke is not visible when outside.
I only applied this fix to SelectionRect
in componenets/tomo
, I did not changed components/plotting/RoiSelectionTool
.
The up-coming version of h5web
will make some change, and both SvgScene
and SelectionRect
will have to be updated, but this is fixing the BM05 issue in the meantime.
Thanks @bocciare for the help with the investigation!
attn @loic.huder