Skip to content

Commit

Permalink
lsp: calculate size and layout of proxies.
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRentzCAU committed Apr 25, 2023
1 parent ae58b85 commit 6941984
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,14 @@ final class RenderingPreparer {
KRendering: {
// every rendering needs an ID, generate it here
KRenderingIdGenerator.generateIdsRecursive(data)
if (data.eContainer instanceof KGraphElement) {
handleKRendering(data.eContainer as KGraphElement, data, null, null)
if (data.eContainer instanceof KNode) {
// Calculate the size and layout of the proxy first.
val parent = data.eContainer as KNode
val minSize = parent.getProperty(KlighdProperties.MINIMAL_NODE_SIZE)
val bounds = PlacementUtil.basicEstimateSize(data, new Bounds(minSize.x, minSize.y))
parent.width = bounds.width
parent.height = bounds.height
handleKRendering(parent, data, null, null)
}
}
}
Expand Down

0 comments on commit 6941984

Please sign in to comment.