From 1489c67e9f95962c4e43060e79bd0863597edb9c Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 14 Dec 2022 19:29:09 -0800 Subject: [PATCH 1/2] always add connection label masks since outside labels may overlap other connections --- d2renderers/d2svg/d2svg.go | 2 ++ 1 file changed, 2 insertions(+) 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) } } From ef60decb76d752b0f317f9c73c1d13b8007da725 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 14 Dec 2022 19:39:42 -0800 Subject: [PATCH 2/2] changelog --- ci/release/changelogs/next.md | 1 + 1 file changed, 1 insertion(+) 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 ⛑️