fix: add clipPath for only ShapeClass and SQLTable

This commit is contained in:
donglixiaoche 2023-03-09 09:41:26 +08:00
parent 39419f221f
commit de42aa58e7
No known key found for this signature in database
GPG key ID: F235CD35048B3752

View file

@ -879,7 +879,7 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske
}
// this clipPath must be defined outside `g` element
if targetShape.BorderRadius != 0 {
if targetShape.BorderRadius != 0 && (targetShape.Type == d2target.ShapeClass || targetShape.Type == d2target.ShapeSQLTable) {
fmt.Fprint(writer, tableHeaderBorderRadius(targetShape))
}
fmt.Fprintf(writer, `<g id="%s"%s>`, svg.EscapeText(targetShape.ID), opacityStyle)