fix: only for none-zero border-radius rect
This commit is contained in:
parent
5994dea83a
commit
b1ae2f520d
2 changed files with 8 additions and 4 deletions
|
|
@ -93,8 +93,10 @@ func drawClass(writer io.Writer, targetShape d2target.Shape) {
|
||||||
el.Height = float64(targetShape.Height)
|
el.Height = float64(targetShape.Height)
|
||||||
el.Fill, el.Stroke = d2themes.ShapeTheme(targetShape)
|
el.Fill, el.Stroke = d2themes.ShapeTheme(targetShape)
|
||||||
el.Style = targetShape.CSSStyle()
|
el.Style = targetShape.CSSStyle()
|
||||||
|
if targetShape.BorderRadius != 0 {
|
||||||
el.Rx = float64(targetShape.BorderRadius)
|
el.Rx = float64(targetShape.BorderRadius)
|
||||||
el.Ry = float64(targetShape.BorderRadius)
|
el.Ry = float64(targetShape.BorderRadius)
|
||||||
|
}
|
||||||
fmt.Fprint(writer, el.Render())
|
fmt.Fprint(writer, el.Render())
|
||||||
|
|
||||||
box := geo.NewBox(
|
box := geo.NewBox(
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,10 @@ func drawTable(writer io.Writer, targetShape d2target.Shape) {
|
||||||
rectEl.Fill, rectEl.Stroke = d2themes.ShapeTheme(targetShape)
|
rectEl.Fill, rectEl.Stroke = d2themes.ShapeTheme(targetShape)
|
||||||
rectEl.ClassName = "shape"
|
rectEl.ClassName = "shape"
|
||||||
rectEl.Style = targetShape.CSSStyle()
|
rectEl.Style = targetShape.CSSStyle()
|
||||||
|
if targetShape.BorderRadius != 0 {
|
||||||
rectEl.Rx = float64(targetShape.BorderRadius)
|
rectEl.Rx = float64(targetShape.BorderRadius)
|
||||||
rectEl.Ry = float64(targetShape.BorderRadius)
|
rectEl.Ry = float64(targetShape.BorderRadius)
|
||||||
|
}
|
||||||
fmt.Fprint(writer, rectEl.Render())
|
fmt.Fprint(writer, rectEl.Render())
|
||||||
|
|
||||||
box := geo.NewBox(
|
box := geo.NewBox(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue