prmr / JetUML

A desktop application for fast UML diagramming.
GNU General Public License v3.0
620 stars 121 forks source link

Node order not preserved during serialization #503

Closed prmr closed 1 year ago

prmr commented 1 year ago

Description The order of nodes is not maintained when a diagram is encoded into JSON. This can lead to unpredictable results when re-loading the diagram, because some aspects of the rendering rely on node ordering (in particular to deal with overlapping nodes).

Steps to reproduce (non-deterministic)

  1. Create a new class diagram (for example)
  2. Create three class nodes, then three note nodes.
  3. Position the note nodes directly on top of the class nodes
  4. Save the file and close the diagram.
  5. Load the file: some note nodes may now be underneath the class nodes.

Configuration

Additional information The reliance on the map data structure in the JsonEncoder causes this problem.