Skip to content

Creating overlapping groups breaks .egn and .egn.svg files #158

@hofstef

Description

@hofstef

Describe the bug
Creating a group on top of another group breaks the export: The JSON contains the second group twice (with the same ID). This causes the import to fail.

This bug only happens when the second group is created while the mouse is within another group:

overlapping-groups

(the mouse cursor is not shown in this sceenshot, but you can see that the first group - named "1" - is highlighted because the mouse is hovering over it)

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Group' in the palette and place it on the canvas.
  2. Click on 'Group' in the palette and move the mouse so that the preview of the new group overlaps with the existing group and that the mouse cursor hovers over the first group.
  3. Click on the canvas to create a second group that overlaps with the first one.
  4. Export as .egn or .egn.svg
  5. The JSON contains 3 groups: The first one, the second one and a duplicate of the second one. See for example attached file.
  6. Import the .egn or egn.svg and open the browser console: The import will fail and stop after it has encountered the element with the duplicate ID.

2 groups intersect a lot - broken egn

Screenshots
[If applicable, add screenshots to help explain your problem.]

Version

  • Egon: v2.1.0
  • Browser: Firefox, Chrome
  • OS: Windows, MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions