Skip to content

Commit

Permalink
fix: inside labelDimension
Browse files Browse the repository at this point in the history
  • Loading branch information
ShupingHe committed Mar 23, 2023
1 parent 806df49 commit fdc91e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions d2layouts/d2near/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ func place(obj *d2graph.Object) (float64, float64) {
func calcLabelDimension(obj *d2graph.Object, x float64, y float64) (float64, float64) {
var position string
if obj.LabelPosition != nil {
if strings.Contains(*obj.LabelPosition, "INSIDE") {
return x, y
}
if strings.Contains(*obj.LabelPosition, "_TOP_") {
position = "TOP"
} else if strings.Contains(*obj.LabelPosition, "_LEFT_") {
Expand Down

0 comments on commit fdc91e7

Please sign in to comment.