Update main.go
This commit is contained in:
parent
abc145ae72
commit
7dee1e82f6
1 changed files with 6 additions and 1 deletions
|
|
@ -454,6 +454,11 @@ func renderPDF(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, ske
|
||||||
}
|
}
|
||||||
|
|
||||||
if !diagram.IsFolderOnly {
|
if !diagram.IsFolderOnly {
|
||||||
|
rootFill := diagram.Root.Fill
|
||||||
|
// gofpdf will print the png img with a slight filter
|
||||||
|
// strip out the background fill within the png so that the background is uniform in the exported pdf
|
||||||
|
diagram.Root.Fill = "transparent"
|
||||||
|
|
||||||
svg, err = d2svg.Render(diagram, &d2svg.RenderOpts{
|
svg, err = d2svg.Render(diagram, &d2svg.RenderOpts{
|
||||||
Pad: int(pad),
|
Pad: int(pad),
|
||||||
Sketch: sketch,
|
Sketch: sketch,
|
||||||
|
|
@ -480,7 +485,7 @@ func renderPDF(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, ske
|
||||||
return svg, err
|
return svg, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pdf.AddPDFPage(pngImg, currBoardPath)
|
err = pdf.AddPDFPage(pngImg, currBoardPath, rootFill)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return svg, err
|
return svg, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue