From 23fe5a5cfecad1b7b0cf09579c25abc069301596 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 20 Aug 2018 19:02:47 +1000 Subject: [PATCH] Change Paragraph.enableWrap default to false to make it hard to unintentional set zero width wrap. --- pdf/creator/paragraph.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf/creator/paragraph.go b/pdf/creator/paragraph.go index 0cbc19dc..09e1bf1c 100644 --- a/pdf/creator/paragraph.go +++ b/pdf/creator/paragraph.go @@ -72,7 +72,6 @@ func NewParagraph(text string) *Paragraph { p.lineHeight = 1.0 // TODO: Can we wrap intellectually, only if given width is known? - p.enableWrap = true p.SetColor(ColorRGBFrom8bit(0, 0, 0)) p.alignment = TextAlignmentLeft p.angle = 0 @@ -172,6 +171,7 @@ func (p *Paragraph) GetMargins() (float64, float64, float64, float64) { // text can extend to prior to wrapping over to next line. func (p *Paragraph) SetWidth(width float64) { p.wrapWidth = width + p.enableWrap = true p.wrapText() }