v0.0.496 wpdf fixes and wpdf test.go
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 4m58s

This commit is contained in:
2024-08-07 15:34:06 +02:00
parent 133aeb8374
commit 741611a2e1
12 changed files with 228 additions and 18 deletions

View File

@@ -16,6 +16,7 @@ type PDFRectOpt struct {
radiusTR *float64
radiusBR *float64
radiusBL *float64
debug *bool
}
func NewPDFRectOpt() *PDFRectOpt {
@@ -90,6 +91,11 @@ func (opt *PDFRectOpt) Alpha(alpha float64, blendMode PDFBlendMode) *PDFRectOpt
return opt
}
func (opt *PDFRectOpt) Debug(v bool) *PDFRectOpt {
opt.debug = &v
return opt
}
func (b *WPDFBuilder) Rect(w float64, h float64, styleStr PDFRectStyle, opts ...*PDFRectOpt) {
x := b.GetX()
y := b.GetY()
@@ -101,6 +107,7 @@ func (b *WPDFBuilder) Rect(w float64, h float64, styleStr PDFRectStyle, opts ...
radiusTR := float64(0)
radiusBR := float64(0)
radiusBL := float64(0)
debug := b.debug
for _, opt := range opts {
x = langext.Coalesce(opt.x, x)
@@ -113,6 +120,7 @@ func (b *WPDFBuilder) Rect(w float64, h float64, styleStr PDFRectStyle, opts ...
radiusTR = langext.Coalesce(opt.radiusTR, radiusTR)
radiusBR = langext.Coalesce(opt.radiusBR, radiusBR)
radiusBL = langext.Coalesce(opt.radiusBL, radiusBL)
debug = langext.Coalesce(opt.debug, debug)
}
if lineWidth != nil {