set default fill color to white for NewPdf
This commit is contained in:
parent
2905171a22
commit
13f1147b90
2 changed files with 3 additions and 4 deletions
|
@ -33,11 +33,12 @@ var (
|
|||
white color.Color = color.RGBA{255, 255, 255, 255}
|
||||
)
|
||||
|
||||
// NewPdf creates a new pdf document with the draw2d fontfolder and
|
||||
// already a page added.
|
||||
// NewPdf creates a new pdf document with the draw2d fontfolder, adds
|
||||
// a page and set fill color to white.
|
||||
func NewPdf(orientationStr, unitStr, sizeStr string) *gofpdf.Fpdf {
|
||||
pdf := gofpdf.New(orientationStr, unitStr, sizeStr, draw2d.GetFontFolder())
|
||||
pdf.AddPage()
|
||||
pdf.SetFillColor(255, 255, 255) // to be compatible with draw2d
|
||||
return pdf
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
"math"
|
||||
|
||||
"github.com/stanim/draw2d"
|
||||
|
@ -24,7 +23,6 @@ func main() {
|
|||
// Size of destination image
|
||||
dw, dh := dest.GetPageSize()
|
||||
// Draw frame
|
||||
gc.SetFillColor(color.RGBA{0xff, 0xff, 0xff, 0xff})
|
||||
draw2d.RoundRect(gc, lineWidth, lineWidth, dw-lineWidth, dh-lineWidth, 100, 100)
|
||||
gc.SetLineWidth(lineWidth)
|
||||
gc.FillStroke()
|
||||
|
|
Loading…
Reference in a new issue