Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hofstef opened this issue Sep 5, 2024 · 2 comments
Open

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

hofstef opened this issue Sep 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@hofstef
Copy link
Member

hofstef commented Sep 5, 2024

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
@hofstef hofstef added the bug Something isn't working label Sep 5, 2024
@hofstef hofstef changed the title Creating overlapping groups break .egn and .egn.svg files Creating overlapping groups breaks .egn and .egn.svg files Sep 5, 2024
@DanielHeckert DanielHeckert self-assigned this Sep 9, 2024
@DanielHeckert
Copy link
Contributor

Should we repair the import for already broken svg- or eng files regarding to the duplicates?

DanielHeckert added a commit that referenced this issue Sep 9, 2024
@DanielHeckert DanielHeckert removed their assignment Sep 10, 2024
@hofstef
Copy link
Member Author

hofstef commented Sep 10, 2024

I don't think that this is necessary as this bug did exist for a short time only and only occured under very specific circumstances. Also, broken .egn and .egn.svg files can be easily fixed manually by deleting the duplicate group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants