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

lsp: remove outermost padding to remove border when exporting SVGs. #197

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

NiklasRentzCAU
Copy link
Member

@NiklasRentzCAU NiklasRentzCAU commented Jul 24, 2024

Usually when exporting the graph with Sprotty, we just export the entire graph as-is. ELK has a default value for its padding of 12 pixels, which is also applied to the outermost invisible graph node, shifting all elements inwards by these 12 pixels.
This fix avoids that issue by removing the outermost padding before the layout on any graph, as that would be invisible anyways. With this, exported graphs will always be snug around the outermost graph elements.

Fixes kieler/klighd-vscode#46.

@NiklasRentzCAU NiklasRentzCAU added enhancement New feature or request LSP Affect the klighd language server. labels Jul 24, 2024
Copy link
Member

@soerendomroes soerendomroes left a comment

Choose a reason for hiding this comment

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

This will probably work.
Maybe we should add an option to disable this?

@NiklasRentzCAU
Copy link
Member Author

I don't see a reason why one would want to always pad the 12 pixels on exported graphs, and why it should be exactly 12. So I would not want to add an option for this.

@NiklasRentzCAU
Copy link
Member Author

@NiklasRentzCAU NiklasRentzCAU merged commit 417fcc9 into master Jul 25, 2024
3 checks passed
@NiklasRentzCAU NiklasRentzCAU deleted the nre/remove-border branch August 7, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request LSP Affect the klighd language server.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export to SVG creates SVG with border
2 participants