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

View file

@ -343,12 +343,12 @@ func (obj *Object) GetFill(theme *d2themes.Theme) string {
return theme.Colors.Neutrals.N7 return theme.Colors.Neutrals.N7
} }
shape := obj.Attributes.Shape.Value if obj.IsSequenceDiagram() {
if strings.EqualFold(shape, d2target.ShapeSequenceDiagram) {
return theme.Colors.Neutrals.N7 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 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 level == 1 {
if !obj.IsContainer() { 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) obj.ChildrenArray = append(obj.ChildrenArray, child)
} }
for _, child := range sd.groups { for _, child := range sd.groups {
if child.Parent == obj { if child.Parent.AbsID() == obj.AbsID() {
obj.Children[child.ID] = child obj.Children[child.ID] = child
obj.ChildrenArray = append(obj.ChildrenArray, child) obj.ChildrenArray = append(obj.ChildrenArray, child)
} }