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

fix: no more empty groups in generated svgs #1235

Merged
merged 1 commit into from
Dec 30, 2024
Merged

fix: no more empty groups in generated svgs #1235

merged 1 commit into from
Dec 30, 2024

Conversation

Onetchou
Copy link
Contributor

When the DOM tree was parsed to remove empty groups, the indexation of the QDomNodeList was being changed each time a node was deleted, to reflect the new state of the DOM tree. The code wasn't taking this into consideration and empty nodes were missed.

Now I'm removing the empty groups 1 by 1, starting the search over each time a node is deleted, to take into consideration the new indexation of the QDomNodeList.

There may be some more efficient ways of cleaning the empty groups, but this one is probably the easiest.

Copy link

what-the-diff bot commented Dec 30, 2024

PR Summary 🌟

  • Simplified Clearout of Empty Groups🚮
    We've upgraded our original loop to a more effective while loop! This continues until every single empty group is gone, ensuring a cleaner experience even when the list alters while removing. Now we'll always have a tidy list, free from unnecessary emptiness!

  • New Arrival - svgCleaned Flag🚩
    Say hello to our new friend - a boolean flag called svgCleaned. This clever little tool helps us keep track if we've removed any groups during an operation. This tiny yet powerful upgrade enhances the process of removing empty SVG groups. More efficiency, less chaos! 🎯

So, look forward to these changes that will help us perform better and keep things in order! 🌈

@Onetchou
Copy link
Contributor Author

Fixes #1236

@Onetchou Onetchou linked an issue Dec 30, 2024 that may be closed by this pull request
Copy link
Contributor

@DSCaskey DSCaskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bravo. Looks good. No longer including empty / hidden labels..etc.

@DSCaskey DSCaskey merged commit c19fe53 into develop Dec 30, 2024
10 checks passed
@DSCaskey DSCaskey deleted the clean_svg branch December 30, 2024 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Empty groups in exported SVGs
2 participants