From eedf31684c3a5cc1ab4ae6dfea0e8c0869c59cfe Mon Sep 17 00:00:00 2001 From: Stani Date: Mon, 6 Jul 2015 15:06:30 +0200 Subject: fix path drawing methods for ArcTo --- fpdf.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fpdf.go b/fpdf.go index fafca6f..ea4b384 100644 --- a/fpdf.go +++ b/fpdf.go @@ -3454,7 +3454,8 @@ func (f *Fpdf) enddoc() { // // See tutorial 30 for an example of this function. func (f *Fpdf) MoveTo(x, y float64) { - f.point(x, y) // rename? + f.point(x, y) + f.x, f.y = x, y } // LineTo creates a line from the current stylus location to (x, y), which @@ -3464,6 +3465,7 @@ func (f *Fpdf) MoveTo(x, y float64) { // See tutorial 30 for an example of this function. func (f *Fpdf) LineTo(x, y float64) { f.outf("%.2f %.2f l", x*f.k, (f.h-y)*f.k) + f.x, f.y = x, y } // CurveTo creates a single-segment quadratic Bézier curve. The curve starts at @@ -3476,6 +3478,7 @@ func (f *Fpdf) LineTo(x, y float64) { // See tutorial 30 for an example of this function. func (f *Fpdf) CurveTo(cx, cy, x, y float64) { f.outf("%.5f %.5f %.5f %.5f v", cx*f.k, (f.h-cy)*f.k, x*f.k, (f.h-y)*f.k) + f.x, f.y = x, y } // CurveBezierCubicTo creates a single-segment cubic Bézier curve. The curve @@ -3488,7 +3491,8 @@ func (f *Fpdf) CurveTo(cx, cy, x, y float64) { // // See tutorial 30 for examples of this function. func (f *Fpdf) CurveBezierCubicTo(cx0, cy0, cx1, cy1, x, y float64) { - f.curve(cx0, cy0, cx1, cy1, x, y) // rename? + f.curve(cx0, cy0, cx1, cy1, x, y) + f.x, f.y = x, y } // ClosePath creates a line from the current location to the last MoveTo point -- cgit v1.2.1-24-ge1ad