We have a lot of requests for additional objects in the figure, not just OMERO Image panels:
Currently, we use CSS transform: scale(fraction) to scale all the figure paper & panels and also overlay a non-scaled <svg> canvas to draw the selected panel outlines and handle dragging and click selections etc. So, each figure panel DOM element has a corresponding svg Rectangle.
We do this so that the blue selection lines don't zoom in thickness when the figure zooms and we don't have to scale the drag events.
However, if we add support for lots of other elements (text, shapes etc) and we want to manipulate them directly, we don't want to duplicate them all on the <svg> too.
We can use ShapeEditor to add these, but maybe also add custom Rectangles for the figure panels (to be hidden when not selected etc).
So, probably need to get rid of the unscaled <svg> and simply handle the drag events with respect to the current zoom so that the CSS transform doesn't have any effect. Also do the same for selection line thicknesses and drag-handle sizes etc.
First TODO is add support for Labels to shape-editor.js.
Also add handling for dragging when scaled via CSS transform: scale(fraction) and size of Drag Handles.
Then, we need to add UI elements to the main figure page for working with Figure-wide Shape Editor.
Model coordinates will be top-left of first page, but does the Shape-Editor canvas need to extend over the whole figure (as the SVG canvas does now). Probably YES since we're using the same canvas for selecting & dragging panels. Convert coordinates as we do currently with getModelCoords(svgCoords).
We have a lot of requests for additional objects in the figure, not just OMERO Image panels:
Currently, we use CSS
transform: scale(fraction)to scale all the figure paper & panels and also overlay a non-scaled<svg>canvas to draw the selected panel outlines and handle dragging and click selections etc. So, each figure panel DOM element has a corresponding svg Rectangle.We do this so that the blue selection lines don't zoom in thickness when the figure zooms and we don't have to scale the drag events.
However, if we add support for lots of other elements (text, shapes etc) and we want to manipulate them directly, we don't want to duplicate them all on the
<svg>too.We can use ShapeEditor to add these, but maybe also add custom Rectangles for the figure panels (to be hidden when not selected etc).
So, probably need to get rid of the unscaled
<svg>and simply handle the drag events with respect to the current zoom so that the CSStransformdoesn't have any effect. Also do the same for selection line thicknesses and drag-handle sizes etc.First TODO is add support for Labels to shape-editor.js.
Also add handling for dragging when scaled via CSS
transform: scale(fraction)and size of Drag Handles.Then, we need to add UI elements to the main figure page for working with Figure-wide Shape Editor.
Model coordinates will be top-left of first page, but does the Shape-Editor canvas need to extend over the whole figure (as the SVG canvas does now). Probably YES since we're using the same canvas for selecting & dragging panels. Convert coordinates as we do currently with
getModelCoords(svgCoords).