Open dario-zamuner-trenolab opened 4 months ago
As I look at the code the SvgElement is immediatly added to the SVG DOM if you call Svg.add(element). The privately hold Hashset is only hold/used as lookup. So order should be preserved on client side.
I used this set to regenerate the svg server-side because I needed to manipulate and export the svg in multiple formats (png, pdf, jpg). I know the original scope of the HashSet was limited, but this is a case where the order is important. I solved my problem by extending the svg class, but it would have been nice not to have to.
In the case of multiple SVG elements layered on top of each other, the order is important. Currently, the elements are stored inside the Svg class as a HashSet. It should be a LinkedHashSet instead.
`public class Svg extends Component implements HasSize, HasStyle {
}`