Merge pull request #447 from gavin-ts/outside-connection-label-masking

render: outside connection label masking
This commit is contained in:
gavin-ts 2023-06-16 10:56:30 -07:00 committed by GitHub
commit fffb08a250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -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 ⛑️

View file

@ -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)
}
}