Skip to content

Commit

Permalink
Merge pull request #197 from kieler/nre/remove-border
Browse files Browse the repository at this point in the history
lsp: remove outermost padding to remove border when exporting SVGs.
  • Loading branch information
NiklasRentzCAU authored Jul 25, 2024
2 parents ddc3477 + 1adac9d commit 417fcc9
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))

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

0 comments on commit 417fcc9

Please sign in to comment.