fix: cr, rename func

This commit is contained in:
donglixiaoche 2023-03-09 16:56:03 +08:00
parent 2d66f3105a
commit a96bb2c0be
No known key found for this signature in database
GPG key ID: F235CD35048B3752
2 changed files with 3 additions and 3 deletions

View file

@ -880,7 +880,7 @@ func drawShape(writer io.Writer, labelMaskID string, targetShape d2target.Shape,
// this clipPath must be defined outside `g` element
if targetShape.BorderRadius != 0 && (targetShape.Type == d2target.ShapeClass || targetShape.Type == d2target.ShapeSQLTable) {
fmt.Fprint(writer, tableHeaderBorderRadius(labelMaskID, targetShape))
fmt.Fprint(writer, clipPathForBorderRadius(labelMaskID, targetShape))
}
fmt.Fprintf(writer, `<g id="%s"%s>`, svg.EscapeText(targetShape.ID), opacityStyle)
tl := geo.NewPoint(float64(targetShape.Pos.X), float64(targetShape.Pos.Y))

View file

@ -13,8 +13,8 @@ import (
"oss.terrastruct.com/util-go/go2"
)
// this func helps define a clipPath for shape class and sql_table
func tableHeaderBorderRadius(labelMaskID string, shape d2target.Shape) string {
// this func helps define a clipPath for shape class and sql_table to draw border-radius
func clipPathForBorderRadius(labelMaskID string, shape d2target.Shape) string {
box := geo.NewBox(
geo.NewPoint(float64(shape.Pos.X), float64(shape.Pos.Y)),
float64(shape.Width),