Skip to content

Commit

Permalink
lsp: remove outermost padding to remove border when exporting SVGs.
Browse files Browse the repository at this point in the history
Fixes #46.
  • Loading branch information
NiklasRentzCAU committed Jul 24, 2024
1 parent ddc3477 commit 96b7743
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import de.cau.cs.kieler.klighd.lsp.utils.RenderingPreparer
import java.io.ByteArrayOutputStream
import java.util.ArrayList
import org.apache.log4j.Logger
import org.eclipse.elk.core.math.ElkPadding
import org.eclipse.elk.core.options.CoreOptions
import org.eclipse.elk.graph.ElkNode
import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
Expand Down Expand Up @@ -70,6 +72,8 @@ class KGraphLayoutEngine extends ElkLayoutEngine {
*/
def onlyLayoutOnKGraph(String uri) {
val kGraphContext = diagramState.getKGraphContext(uri)
// Remove any padding from the root node to avoid blank padding around the edge of the entire graph.
kGraphContext.viewModel.setProperty(CoreOptions.PADDING, new ElkPadding(0, 0, 0, 0))

// layout of KGraph
val lightDiagramLayoutConfig = new LightDiagramLayoutConfig(kGraphContext)
Expand Down

0 comments on commit 96b7743

Please sign in to comment.