summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
}
}