summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Seletskiy <s.seletskiy@gmail.com>2019-07-18 15:41:13 +0300
committerStanislav Seletskiy <s.seletskiy@gmail.com>2019-07-18 15:41:31 +0300
commitd0f2d2e94a89ab84c0c647ebb0873f43593d89fd (patch)
treeac5447113b722949ea8cb32a05ad8835d29babed
parenta542cf333bc2e3e4e138bb4848f02997aba71ce9 (diff)
fix bug introduced in #279
-rw-r--r--fpdf.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdf.go b/fpdf.go
index b3d0b0e..f46680b 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -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)
}
}