reverts
This commit is contained in:
parent
e8a473f0fd
commit
a85a225c73
2 changed files with 7 additions and 9 deletions
|
|
@ -377,12 +377,11 @@ func render(ctx context.Context, ms *xmain.State, compileDur time.Duration, plug
|
||||||
func _render(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketch bool, pad int64, themeID int64, darkThemeID *int64, outputPath string, bundle, forceAppendix bool, page playwright.Page, ruler *textmeasure.Ruler, diagram *d2target.Diagram) ([]byte, error) {
|
func _render(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketch bool, pad int64, themeID int64, darkThemeID *int64, outputPath string, bundle, forceAppendix bool, page playwright.Page, ruler *textmeasure.Ruler, diagram *d2target.Diagram) ([]byte, error) {
|
||||||
toPNG := filepath.Ext(outputPath) == ".png"
|
toPNG := filepath.Ext(outputPath) == ".png"
|
||||||
svg, err := d2svg.Render(diagram, &d2svg.RenderOpts{
|
svg, err := d2svg.Render(diagram, &d2svg.RenderOpts{
|
||||||
Pad: int(pad),
|
Pad: int(pad),
|
||||||
Sketch: sketch,
|
Sketch: sketch,
|
||||||
ThemeID: themeID,
|
ThemeID: themeID,
|
||||||
DarkThemeID: darkThemeID,
|
DarkThemeID: darkThemeID,
|
||||||
// SetDimensions: toPNG,
|
SetDimensions: toPNG,
|
||||||
SetDimensions: true,
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -460,7 +459,7 @@ func renderPDF(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, ske
|
||||||
rootFill := diagram.Root.Fill
|
rootFill := diagram.Root.Fill
|
||||||
// gofpdf will print the png img with a slight filter
|
// gofpdf will print the png img with a slight filter
|
||||||
// make the bg fill within the png transparent so that the pdf bg fill is the only bg color present
|
// make the bg fill within the png transparent so that the pdf bg fill is the only bg color present
|
||||||
// diagram.Root.Fill = "transparent"
|
diagram.Root.Fill = "transparent"
|
||||||
|
|
||||||
svg, err = d2svg.Render(diagram, &d2svg.RenderOpts{
|
svg, err = d2svg.Render(diagram, &d2svg.RenderOpts{
|
||||||
Pad: int(pad),
|
Pad: int(pad),
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,7 @@ func (g *GoFPDF) AddPDFPage(png []byte, boardPath []string, themeID int64, fill
|
||||||
headerMargin := 28.0
|
headerMargin := 28.0
|
||||||
headerWidth := g.pdf.GetStringWidth(pathString) + 2*headerMargin
|
headerWidth := g.pdf.GetStringWidth(pathString) + 2*headerMargin
|
||||||
|
|
||||||
// minPageDimension := 576.0
|
minPageDimension := 576.0
|
||||||
minPageDimension := 0.0
|
|
||||||
pageWidth = math.Max(math.Max(minPageDimension, imageWidth), headerWidth)
|
pageWidth = math.Max(math.Max(minPageDimension, imageWidth), headerWidth)
|
||||||
pageHeight = math.Max(minPageDimension, imageHeight)
|
pageHeight = math.Max(minPageDimension, imageHeight)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue