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 {
|
// 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.Fprint(buf, strings.Join([]string{
|
||||||
fmt.Sprintf(`<mask id="%s" maskUnits="userSpaceOnUse" x="0" y="0" width="%d" height="%d">`,
|
fmt.Sprintf(`<mask id="%s" maskUnits="userSpaceOnUse" x="0" y="0" width="%d" height="%d">`,
|
||||||
labelMaskID, w, h,
|
labelMaskID, w, h,
|
||||||
),
|
),
|
||||||
fmt.Sprintf(`<rect x="0" y="0" width="%d" height="%d" fill="white"></rect>`,
|
fmt.Sprintf(`<rect x="0" y="0" width="%d" height="%d" fill="white"></rect>`,
|
||||||
w,
|
w,
|
||||||
h,
|
h,
|
||||||
),
|
),
|
||||||
strings.Join(labelMasks, "\n"),
|
strings.Join(labelMasks, "\n"),
|
||||||
`</mask>`,
|
`</mask>`,
|
||||||
}, "\n"))
|
}, "\n"))
|
||||||
}
|
|
||||||
|
|
||||||
embedFonts(buf)
|
embedFonts(buf)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue