elk icon indicating copy to clipboard operation
elk copied to clipboard

Positioning of inline labels is off in vertical layout

Open NiklasRentzCAU opened this issue 3 years ago • 2 comments

I assume inline labels to be centered on their parent edge, i.e. the label "i" of the following graph should completely overlay the edge behind it. In reality though the label if offset by 1-2 pixels to the left.

elk.direction: DOWN
node a
node b
edge a -> b {
	label "i" {
		edgeLabels.inline: true
	}
}

Causes issue kieler/KLighD#116

NiklasRentzCAU avatar May 23 '22 11:05 NiklasRentzCAU

I tried to just add 1 pixel:

It does not always seem to be the case (as seen below) that this fixes the issue. jette-stpa

But in some models it seems to be correct:

elk.direction: DOWN
considerModelOrder.components: FORCE_MODEL_ORDER
node a
node b
edge a -> b {
  label "i" {
    edgeLabels.inline: true
  }
}

node c
node d
edge c -> d {
  label "w" {
    edgeLabels.inline: true
  }
}

node e
node f
edge e -> f {
  label "i" {
    edgeLabels.inline: true
  }
}

841_inlineEdgeLabels

soerendomroes avatar Jul 13 '22 12:07 soerendomroes

The issue seems to be the edgeLabel spacing (which is 2.0) per default.

soerendomroes avatar Jul 13 '22 12:07 soerendomroes