This commit is contained in:
Alexander Wang 2022-12-05 14:30:40 -08:00
parent 4ed0ebc58b
commit d90eb355d3
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
3 changed files with 5 additions and 6 deletions

View file

@ -3,7 +3,6 @@ package d2exporter
import (
"context"
"strconv"
"strings"
"oss.terrastruct.com/d2/d2graph"
"oss.terrastruct.com/d2/d2target"
@ -100,7 +99,7 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape {
shape.Italic = text.IsItalic
shape.FontSize = text.FontSize
if strings.EqualFold(obj.Attributes.Shape.Value, d2target.ShapeSequenceDiagram) {
if obj.IsSequenceDiagram() {
shape.StrokeWidth = 0
}

View file

@ -343,12 +343,12 @@ func (obj *Object) GetFill(theme *d2themes.Theme) string {
return theme.Colors.Neutrals.N7
}
shape := obj.Attributes.Shape.Value
if strings.EqualFold(shape, d2target.ShapeSequenceDiagram) {
if obj.IsSequenceDiagram() {
return theme.Colors.Neutrals.N7
}
shape := obj.Attributes.Shape.Value
if shape == "" || strings.EqualFold(shape, d2target.ShapeSquare) || strings.EqualFold(shape, d2target.ShapeCircle) || strings.EqualFold(shape, d2target.ShapeOval) || strings.EqualFold(shape, d2target.ShapeRectangle) {
if level == 1 {
if !obj.IsContainer() {

View file

@ -156,7 +156,7 @@ func cleanup(g *d2graph.Graph, sequenceDiagrams map[string]*sequenceDiagram, obj
obj.ChildrenArray = append(obj.ChildrenArray, child)
}
for _, child := range sd.groups {
if child.Parent == obj {
if child.Parent.AbsID() == obj.AbsID() {
obj.Children[child.ID] = child
obj.ChildrenArray = append(obj.ChildrenArray, child)
}