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: bounding boxes of exported svg pattern pieces are now correct #1221

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

Onetchou
Copy link
Contributor

@Onetchou Onetchou commented Nov 23, 2024

Fixes #1197

Copy link

what-the-diff bot commented Nov 23, 2024

🎉 PR Summary 📝

🔹 Enhanced SVG Merging Approach: We have redefined how SVG files merge to improve the performance and ensure consistency. This reduces any potential issues and enhances the smooth running of your document. 📋

🔹 Clever Removal of '' Tags: There are times when a pesky '' tag can create problems in your merged SVG. To solve this, we've added an intelligent check that will automatically spot and remove these if they're present, keeping your document clean and efficient.👌

🔹 Slight Shift in Iterating Method: Now our iterators kick off correctly from the ground level (that's 0) which aligns perfectly with standard computing practices and provides a seamless experience. 🔄

🔹 New Superhero Functions🦸‍♂️:

  • removeEmptyGroups: This hero swoops in, spotting and getting rid of any empty '' groups that might slow down the performance of the SVG.
  • removeEmptyOriginPath: This function removes paths from the SVG that aren't going anywhere, preventing any possible issues and keeping everything running smoothly.
  • cleanSvg: Acting as a heroic coordinator, this function summons removeEmptyGroups and removeEmptyOriginPath to tidy ups the SVG doc, ultimately promoting clean, efficient and error-free operation.✨

🔹 Code Purification: We've also spruced up addSvgFromScene, tidying up and removing unnecessary whitespaces. It's like spring cleaning for your code!💖

🔹 Header File Refresh: We've updated the svg_generator.h file with the new function declarations, ensuring everything is up-to-date and ready for action. 🚀

Every update in this PR means a more robust, efficient, and cleaner way of dealing with SVG documents. Let's continue making our project the best it can be! 🌟

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.

Looks good to me. I did a test export and the empty groups are no longer included causing an incorrect bounding box.

@DSCaskey DSCaskey merged commit ec1a058 into develop Nov 24, 2024
10 checks passed
@DSCaskey DSCaskey deleted the origin-in-svg branch November 24, 2024 08:48
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: SVG group includes origin point 0,0
2 participants