fix: cr, rename func
This commit is contained in:
parent
2d66f3105a
commit
a96bb2c0be
2 changed files with 3 additions and 3 deletions
|
|
@ -880,7 +880,7 @@ func drawShape(writer io.Writer, labelMaskID string, targetShape d2target.Shape,
|
||||||
|
|
||||||
// this clipPath must be defined outside `g` element
|
// this clipPath must be defined outside `g` element
|
||||||
if targetShape.BorderRadius != 0 && (targetShape.Type == d2target.ShapeClass || targetShape.Type == d2target.ShapeSQLTable) {
|
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)
|
fmt.Fprintf(writer, `<g id="%s"%s>`, svg.EscapeText(targetShape.ID), opacityStyle)
|
||||||
tl := geo.NewPoint(float64(targetShape.Pos.X), float64(targetShape.Pos.Y))
|
tl := geo.NewPoint(float64(targetShape.Pos.X), float64(targetShape.Pos.Y))
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ import (
|
||||||
"oss.terrastruct.com/util-go/go2"
|
"oss.terrastruct.com/util-go/go2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// this func helps define a clipPath for shape class and sql_table
|
// this func helps define a clipPath for shape class and sql_table to draw border-radius
|
||||||
func tableHeaderBorderRadius(labelMaskID string, shape d2target.Shape) string {
|
func clipPathForBorderRadius(labelMaskID string, shape d2target.Shape) string {
|
||||||
box := geo.NewBox(
|
box := geo.NewBox(
|
||||||
geo.NewPoint(float64(shape.Pos.X), float64(shape.Pos.Y)),
|
geo.NewPoint(float64(shape.Pos.X), float64(shape.Pos.Y)),
|
||||||
float64(shape.Width),
|
float64(shape.Width),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue