diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 823e8dd45..0202204b5 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -5,6 +5,7 @@ #### Improvements 🧹 - Display version on CLI help invocation [#1400](https://github.com/terrastruct/d2/pull/1400) +- Improved readability of connection labels when they overlap another connection. [#447](https://github.com/terrastruct/d2/pull/447) #### Bugfixes ⛑️ diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index 11996eb54..0c9c44943 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -516,6 +516,8 @@ func drawConnection(writer io.Writer, labelMaskID string, connection d2target.Co if label.Position(connection.LabelPosition).IsOnEdge() { labelMask = makeLabelMask(labelTL, connection.LabelWidth, connection.LabelHeight, 1) + } else { + labelMask = makeLabelMask(labelTL, connection.LabelWidth, connection.LabelHeight, 0.75) } }