always define the referenced mask
This commit is contained in:
parent
d25bb79857
commit
f166077e7b
1 changed files with 12 additions and 13 deletions
|
|
@ -1024,19 +1024,18 @@ func Render(diagram *d2target.Diagram, pad int) ([]byte, error) {
|
|||
}
|
||||
}
|
||||
|
||||
if len(labelMasks) > 0 {
|
||||
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(`<rect x="0" y="0" width="%d" height="%d" fill="white"></rect>`,
|
||||
w,
|
||||
h,
|
||||
),
|
||||
strings.Join(labelMasks, "\n"),
|
||||
`</mask>`,
|
||||
}, "\n"))
|
||||
}
|
||||
// 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(`<rect x="0" y="0" width="%d" height="%d" fill="white"></rect>`,
|
||||
w,
|
||||
h,
|
||||
),
|
||||
strings.Join(labelMasks, "\n"),
|
||||
`</mask>`,
|
||||
}, "\n"))
|
||||
|
||||
embedFonts(buf)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue