diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index a3776ba8d..ea7e4f2aa 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -6,4 +6,6 @@ #### Bugfixes ⛑️ -- Compiler: fixes panic when `sql_shape` shape value had mixed casing [#2349](https://github.com/terrastruct/d2/pull/2349) +- Compiler: + - fixes panic when `sql_shape` shape value had mixed casing [#2349](https://github.com/terrastruct/d2/pull/2349) + - fixes support for `center` in `d2-config` [#2360](https://github.com/terrastruct/d2/pull/2360) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 4a5e22c53..e8af01b14 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1455,6 +1455,12 @@ func compileConfig(ir *d2ir.Map) (*d2target.Config, error) { config.LayoutEngine = go2.Pointer(f.Primary().Value.ScalarString()) } + f = configMap.GetField(d2ast.FlatUnquotedString("center")) + if f != nil { + val, _ := strconv.ParseBool(f.Primary().Value.ScalarString()) + config.Center = &val + } + f = configMap.GetField(d2ast.FlatUnquotedString("theme-overrides")) if f != nil { overrides, err := compileThemeOverrides(f.Map())