fix connection mask clipping along top and left edges of graph
This commit is contained in:
parent
ddcd6b5d54
commit
1434306948
1 changed files with 4 additions and 5 deletions
|
|
@ -1035,12 +1035,11 @@ func Render(diagram *d2target.Diagram, pad int) ([]byte, error) {
|
|||
|
||||
// Note: we always want this since we reference it on connections even if there end up being no masked labels
|
||||
fmt.Fprint(buf, strings.Join([]string{
|
||||
fmt.Sprintf(`<mask id="%s" maskUnits="userSpaceOnUse" x="0" y="0" width="%d" height="%d">`,
|
||||
labelMaskID, w, h,
|
||||
fmt.Sprintf(`<mask id="%s" maskUnits="userSpaceOnUse" x="%d" y="%d" width="%d" height="%d">`,
|
||||
labelMaskID, -pad, -pad, w, h,
|
||||
),
|
||||
fmt.Sprintf(`<rect x="0" y="0" width="%d" height="%d" fill="white"></rect>`,
|
||||
w,
|
||||
h,
|
||||
fmt.Sprintf(`<rect x="%d" y="%d" width="%d" height="%d" fill="white"></rect>`,
|
||||
-pad, -pad, w, h,
|
||||
),
|
||||
strings.Join(labelMasks, "\n"),
|
||||
`</mask>`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue