fit svg to top left by default

This commit is contained in:
Gavin Nishizawa 2023-03-01 17:40:28 -08:00
parent 91e0bbdf54
commit 94b2a39a70
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

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