option placing in center rather than top left

This commit is contained in:
Gavin Nishizawa 2023-02-24 16:27:34 -08:00
parent fd2955fb56
commit b43e2a44b4
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -1568,7 +1568,7 @@ func Render(diagram *d2target.Diagram, opts *RenderOpts) ([]byte, error) {
backgroundEl.Height = float64(h) backgroundEl.Height = float64(h)
backgroundEl.Fill = BG_COLOR backgroundEl.Fill = BG_COLOR
fitToScreenWrapper := fmt.Sprintf(`<svg %s preserveAspectRatio="xMinYMin meet" viewBox="0 0 %d %d">`, fitToScreenWrapper := fmt.Sprintf(`<svg %s preserveAspectRatio="xMidYMid meet" viewBox="0 0 %d %d">`,
`xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"`, `xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"`,
w, h, w, h,
) )