diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go
index 853a7b285..4e4da7075 100644
--- a/e2etests/stable_test.go
+++ b/e2etests/stable_test.go
@@ -2782,6 +2782,7 @@ scenarios: {
loadFromFile(t, "outside_bottom_labels"),
loadFromFile(t, "label_positions"),
loadFromFile(t, "icon_positions"),
+ loadFromFile(t, "centered_horizontal_connections"),
loadFromFile(t, "all_shapes_link"),
loadFromFile(t, "nested_shape_labels"),
loadFromFile(t, "dagre_spacing"),
diff --git a/e2etests/testdata/files/centered_horizontal_connections.d2 b/e2etests/testdata/files/centered_horizontal_connections.d2
new file mode 100644
index 000000000..1b4e4f691
--- /dev/null
+++ b/e2etests/testdata/files/centered_horizontal_connections.d2
@@ -0,0 +1,46 @@
+direction: right
+
+style: {
+ fill: transparent
+}
+
+classes: {
+ rare: {
+ shape: image
+ icon: https://raw.githubusercontent.com/frederic-loui/RARE-web/automated-update/docs/img/rare.svg
+ width: 32
+ height: 32
+ }
+ xrd: {
+ shape: image
+ icon: https://raw.githubusercontent.com/frederic-loui/RARE-web/automated-update/docs/img/xrd.svg
+ width: 32
+ height: 32
+ }
+ vr-xrv9k: {
+ shape: image
+ icon: https://raw.githubusercontent.com/frederic-loui/RARE-web/automated-update/docs/img/vr-xrv9k.svg
+ width: 32
+ height: 32
+ }
+ linux: {
+ shape: image
+ icon: https://raw.githubusercontent.com/frederic-loui/RARE-web/automated-update/docs/img/linux.svg
+ width: 32
+ height: 32
+ }
+ crpd: {
+ shape: image
+ icon: https://raw.githubusercontent.com/frederic-loui/RARE-web/automated-update/docs/img/crpd.svg
+ width: 32
+ height: 32
+ }
+}
+
+r1.class: rare
+r2.class: rare
+
+r1 <-> r2: {
+ source-arrowhead.label: eth1
+ target-arrowhead.label: eth1
+}
diff --git a/e2etests/testdata/stable/centered_horizontal_connections/dagre/board.exp.json b/e2etests/testdata/stable/centered_horizontal_connections/dagre/board.exp.json
new file mode 100644
index 000000000..9209f1046
--- /dev/null
+++ b/e2etests/testdata/stable/centered_horizontal_connections/dagre/board.exp.json
@@ -0,0 +1,232 @@
+{
+ "name": "",
+ "isFolderOnly": false,
+ "fontFamily": "SourceSansPro",
+ "shapes": [
+ {
+ "id": "r1",
+ "type": "image",
+ "classes": [
+ "rare"
+ ],
+ "pos": {
+ "x": 0,
+ "y": 0
+ },
+ "width": 32,
+ "height": 32,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "N7",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": {
+ "Scheme": "https",
+ "Opaque": "",
+ "User": null,
+ "Host": "raw.githubusercontent.com",
+ "Path": "/frederic-loui/RARE-web/automated-update/docs/img/rare.svg",
+ "RawPath": "",
+ "OmitHost": false,
+ "ForceQuery": false,
+ "RawQuery": "",
+ "Fragment": "",
+ "RawFragment": ""
+ },
+ "iconPosition": "INSIDE_MIDDLE_CENTER",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "r1",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 14,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "r2",
+ "type": "image",
+ "classes": [
+ "rare"
+ ],
+ "pos": {
+ "x": 132,
+ "y": 0
+ },
+ "width": 32,
+ "height": 32,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "N7",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": {
+ "Scheme": "https",
+ "Opaque": "",
+ "User": null,
+ "Host": "raw.githubusercontent.com",
+ "Path": "/frederic-loui/RARE-web/automated-update/docs/img/rare.svg",
+ "RawPath": "",
+ "OmitHost": false,
+ "ForceQuery": false,
+ "RawQuery": "",
+ "Fragment": "",
+ "RawFragment": ""
+ },
+ "iconPosition": "INSIDE_MIDDLE_CENTER",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "r2",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 14,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": [
+ {
+ "id": "(r1 <-> r2)[0]",
+ "src": "r1",
+ "srcArrow": "triangle",
+ "srcLabel": {
+ "label": "eth1",
+ "fontSize": 0,
+ "fontFamily": "",
+ "language": "",
+ "color": "",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 29,
+ "labelHeight": 21
+ },
+ "dst": "r2",
+ "dstArrow": "triangle",
+ "dstLabel": {
+ "label": "eth1",
+ "fontSize": 0,
+ "fontFamily": "",
+ "language": "",
+ "color": "",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 29,
+ "labelHeight": 21
+ },
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "stroke": "B1",
+ "borderRadius": 10,
+ "label": "",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N2",
+ "italic": true,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 0,
+ "labelHeight": 0,
+ "labelPosition": "",
+ "labelPercentage": 0,
+ "route": [
+ {
+ "x": 32,
+ "y": 29
+ },
+ {
+ "x": 72,
+ "y": 29
+ },
+ {
+ "x": 92,
+ "y": 29
+ },
+ {
+ "x": 132,
+ "y": 29
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ }
+ ],
+ "root": {
+ "id": "",
+ "type": "",
+ "pos": {
+ "x": 0,
+ "y": 0
+ },
+ "width": 0,
+ "height": 0,
+ "opacity": 0,
+ "strokeDash": 0,
+ "strokeWidth": 0,
+ "borderRadius": 0,
+ "fill": "transparent",
+ "stroke": "",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "",
+ "fontSize": 0,
+ "fontFamily": "",
+ "language": "",
+ "color": "",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 0,
+ "labelHeight": 0,
+ "zIndex": 0,
+ "level": 0
+ }
+}
diff --git a/e2etests/testdata/stable/centered_horizontal_connections/dagre/sketch.exp.svg b/e2etests/testdata/stable/centered_horizontal_connections/dagre/sketch.exp.svg
new file mode 100644
index 000000000..cdcc7ed57
--- /dev/null
+++ b/e2etests/testdata/stable/centered_horizontal_connections/dagre/sketch.exp.svg
@@ -0,0 +1,103 @@
+
\ No newline at end of file
diff --git a/e2etests/testdata/stable/centered_horizontal_connections/elk/board.exp.json b/e2etests/testdata/stable/centered_horizontal_connections/elk/board.exp.json
new file mode 100644
index 000000000..fdf65ac74
--- /dev/null
+++ b/e2etests/testdata/stable/centered_horizontal_connections/elk/board.exp.json
@@ -0,0 +1,223 @@
+{
+ "name": "",
+ "isFolderOnly": false,
+ "fontFamily": "SourceSansPro",
+ "shapes": [
+ {
+ "id": "r1",
+ "type": "image",
+ "classes": [
+ "rare"
+ ],
+ "pos": {
+ "x": 12,
+ "y": 12
+ },
+ "width": 32,
+ "height": 32,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "N7",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": {
+ "Scheme": "https",
+ "Opaque": "",
+ "User": null,
+ "Host": "raw.githubusercontent.com",
+ "Path": "/frederic-loui/RARE-web/automated-update/docs/img/rare.svg",
+ "RawPath": "",
+ "OmitHost": false,
+ "ForceQuery": false,
+ "RawQuery": "",
+ "Fragment": "",
+ "RawFragment": ""
+ },
+ "iconPosition": "INSIDE_MIDDLE_CENTER",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "r1",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 14,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "r2",
+ "type": "image",
+ "classes": [
+ "rare"
+ ],
+ "pos": {
+ "x": 114,
+ "y": 12
+ },
+ "width": 32,
+ "height": 32,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "N7",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": {
+ "Scheme": "https",
+ "Opaque": "",
+ "User": null,
+ "Host": "raw.githubusercontent.com",
+ "Path": "/frederic-loui/RARE-web/automated-update/docs/img/rare.svg",
+ "RawPath": "",
+ "OmitHost": false,
+ "ForceQuery": false,
+ "RawQuery": "",
+ "Fragment": "",
+ "RawFragment": ""
+ },
+ "iconPosition": "INSIDE_MIDDLE_CENTER",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "r2",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 14,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": [
+ {
+ "id": "(r1 <-> r2)[0]",
+ "src": "r1",
+ "srcArrow": "triangle",
+ "srcLabel": {
+ "label": "eth1",
+ "fontSize": 0,
+ "fontFamily": "",
+ "language": "",
+ "color": "",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 29,
+ "labelHeight": 21
+ },
+ "dst": "r2",
+ "dstArrow": "triangle",
+ "dstLabel": {
+ "label": "eth1",
+ "fontSize": 0,
+ "fontFamily": "",
+ "language": "",
+ "color": "",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 29,
+ "labelHeight": 21
+ },
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "stroke": "B1",
+ "borderRadius": 10,
+ "label": "",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N2",
+ "italic": true,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 0,
+ "labelHeight": 0,
+ "labelPosition": "",
+ "labelPercentage": 0,
+ "route": [
+ {
+ "x": 44,
+ "y": 41
+ },
+ {
+ "x": 114,
+ "y": 41
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ }
+ ],
+ "root": {
+ "id": "",
+ "type": "",
+ "pos": {
+ "x": 0,
+ "y": 0
+ },
+ "width": 0,
+ "height": 0,
+ "opacity": 0,
+ "strokeDash": 0,
+ "strokeWidth": 0,
+ "borderRadius": 0,
+ "fill": "transparent",
+ "stroke": "",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "",
+ "fontSize": 0,
+ "fontFamily": "",
+ "language": "",
+ "color": "",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 0,
+ "labelHeight": 0,
+ "zIndex": 0,
+ "level": 0
+ }
+}
diff --git a/e2etests/testdata/stable/centered_horizontal_connections/elk/sketch.exp.svg b/e2etests/testdata/stable/centered_horizontal_connections/elk/sketch.exp.svg
new file mode 100644
index 000000000..42992a009
--- /dev/null
+++ b/e2etests/testdata/stable/centered_horizontal_connections/elk/sketch.exp.svg
@@ -0,0 +1,103 @@
+r1r2 eth1eth1
+
+
+
+
\ No newline at end of file