diff options
author | Stanislav Seletskiy <s.seletskiy@gmail.com> | 2019-07-18 15:41:13 +0300 |
---|---|---|
committer | Stanislav Seletskiy <s.seletskiy@gmail.com> | 2019-07-18 15:41:31 +0300 |
commit | d0f2d2e94a89ab84c0c647ebb0873f43593d89fd (patch) | |
tree | ac5447113b722949ea8cb32a05ad8835d29babed | |
parent | a542cf333bc2e3e4e138bb4848f02997aba71ce9 (diff) |
fix bug introduced in #279
-rw-r--r-- | fpdf.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2819,7 +2819,6 @@ func (f *Fpdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) lineStr := string(lineBt) lineWidth := f.GetStringWidth(lineStr) - f.SetLeftMargin(lMargin + (width - lineWidth) - 2.01*f.cMargin) switch alignStr { case "C": f.SetLeftMargin(lMargin + ((width - lineWidth) / 2)) @@ -2830,9 +2829,10 @@ func (f *Fpdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) f.Write(lineHeight, lineStr) f.SetLeftMargin(lMargin) default: + f.SetRightMargin(pageWidth - lMargin - width) f.Write(lineHeight, lineStr) + f.SetRightMargin(rMargin) } - f.SetRightMargin(rMargin) } } |