Skip to content

Commit d59285a

Browse files
committed
ta
1 parent a754020 commit d59285a

File tree

91 files changed

+207
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+207
-207
lines changed

d2exporter/export.go

+24-24
Original file line numberDiff line numberDiff line change
@@ -93,31 +93,31 @@ func applyTheme(shape *d2target.Shape, obj *d2graph.Object, theme *d2themes.Them
9393
shape.Color = color.N1
9494
}
9595
}
96-
}
97-
if theme.SpecialRules.C4 && obj.Level() == 1 && len(obj.ChildrenArray) == 0 &&
98-
obj.Shape.Value != d2target.ShapePerson && obj.Shape.Value != d2target.ShapeC4Person {
99-
if obj.Style.Fill == nil {
100-
shape.Fill = color.B6
101-
}
102-
if obj.Style.Stroke == nil {
103-
shape.Stroke = color.B5
104-
}
105-
}
106-
if theme.SpecialRules.C4 && (obj.Shape.Value == d2target.ShapePerson || obj.Shape.Value == d2target.ShapeC4Person) {
107-
if obj.Style.Fill == nil {
108-
shape.Fill = color.B2
109-
}
110-
if obj.Style.Stroke == nil {
111-
shape.Stroke = color.B1
96+
if theme.SpecialRules.C4 && obj.Level() == 1 && len(obj.ChildrenArray) == 0 &&
97+
obj.Shape.Value != d2target.ShapePerson && obj.Shape.Value != d2target.ShapeC4Person {
98+
if obj.Style.Fill == nil {
99+
shape.Fill = color.B6
100+
}
101+
if obj.Style.Stroke == nil {
102+
shape.Stroke = color.B5
103+
}
112104
}
113-
}
114-
if theme.SpecialRules.C4 && obj.Level() > 1 && len(obj.ChildrenArray) == 0 &&
115-
obj.Shape.Value != d2target.ShapePerson && obj.Shape.Value != d2target.ShapeC4Person {
116-
if obj.Style.Fill == nil {
117-
shape.Fill = color.B4
105+
if theme.SpecialRules.C4 && (obj.Shape.Value == d2target.ShapePerson || obj.Shape.Value == d2target.ShapeC4Person) {
106+
if obj.Style.Fill == nil {
107+
shape.Fill = color.B2
108+
}
109+
if obj.Style.Stroke == nil {
110+
shape.Stroke = color.B1
111+
}
118112
}
119-
if obj.Style.Stroke == nil {
120-
shape.Stroke = color.B3
113+
if theme.SpecialRules.C4 && obj.Level() > 1 && len(obj.ChildrenArray) == 0 &&
114+
obj.Shape.Value != d2target.ShapePerson && obj.Shape.Value != d2target.ShapeC4Person {
115+
if obj.Style.Fill == nil {
116+
shape.Fill = color.B4
117+
}
118+
if obj.Style.Stroke == nil {
119+
shape.Stroke = color.B3
120+
}
121121
}
122122
}
123123
}
@@ -205,7 +205,7 @@ func toShape(obj *d2graph.Object, g *d2graph.Graph) d2target.Shape {
205205
applyStyles(shape, obj)
206206
applyTheme(shape, obj, g.Theme)
207207
shape.Color = text.GetColor(shape.Italic)
208-
if g.Theme.SpecialRules.C4 {
208+
if g.Theme != nil && g.Theme.SpecialRules.C4 {
209209
if obj.Style.FontColor == nil {
210210
if len(obj.ChildrenArray) > 0 {
211211
shape.Color = color.N1

d2renderers/d2sketch/testdata/opacity/sketch.exp.svg

+1-1
Loading

d2renderers/d2sketch/testdata/opacity_dark/sketch.exp.svg

+1-1
Loading

d2renderers/d2sketch/testdata/root-fill/sketch.exp.svg

+1-1
Loading

d2renderers/d2sketch/testdata/twitter/sketch.exp.svg

+2-2
Loading

d2renderers/d2sketch/testdata/twitter_dark/sketch.exp.svg

+2-2
Loading

d2renderers/d2svg/dark_theme/testdata/code/dark_theme.exp.svg

+1-1
Loading

d2renderers/d2svg/dark_theme/testdata/opacity/dark_theme.exp.svg

+1-1
Loading

0 commit comments

Comments
 (0)