summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStani <spe.stani.be@gmail.com>2015-07-06 15:06:30 +0200
committerStani <spe.stani.be@gmail.com>2015-07-06 15:06:30 +0200
commiteedf31684c3a5cc1ab4ae6dfea0e8c0869c59cfe (patch)
tree91cec747434dc9945a7f2cb565fc0a69f75760b9
parent0739cc03f4ea4bd99bf3d695b8574a19dfdaccbd (diff)
fix path drawing methods for ArcTo
-rw-r--r--fpdf.go8
1 files 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