From 3378745af4dea5aec81d5300f5b6340106442049 Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Fri, 28 Feb 2020 08:54:33 +0100 Subject: [PATCH] fixed method order --- paths.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/paths.go b/paths.go index 3998b1c..d9b0fb2 100644 --- a/paths.go +++ b/paths.go @@ -54,6 +54,15 @@ func (cv *Canvas) QuadraticCurveTo(x1, y1, x2, y2 float64) { cv.path.QuadraticCurveTo(tf1[0], tf1[1], tf2[0], tf2[1]) } +// BezierCurveTo adds a bezier curve to the path. It uses the current end point +// of the path, x1/y1 and x2/y2 define the curve, and x3/y3 is the end point +func (cv *Canvas) BezierCurveTo(x1, y1, x2, y2, x3, y3 float64) { + tf1 := cv.tf(vec{x1, y1}) + tf2 := cv.tf(vec{x2, y2}) + tf3 := cv.tf(vec{x3, y3}) + cv.path.BezierCurveTo(tf1[0], tf1[1], tf2[0], tf2[1], tf3[0], tf3[1]) +} + // Ellipse adds an ellipse segment to the end of the path. x/y is the center, // radiusX is the major axis radius, radiusY is the minor axis radius, // rotation is the rotation of the ellipse in radians, startAngle and endAngle @@ -67,15 +76,6 @@ func (cv *Canvas) Ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle cv.path.Ellipse(tf[0], tf[1], radiusX, radiusY, rotation, startAngle2, endAngle2, anticlockwise) } -// BezierCurveTo adds a bezier curve to the path. It uses the current end point -// of the path, x1/y1 and x2/y2 define the curve, and x3/y3 is the end point -func (cv *Canvas) BezierCurveTo(x1, y1, x2, y2, x3, y3 float64) { - tf1 := cv.tf(vec{x1, y1}) - tf2 := cv.tf(vec{x2, y2}) - tf3 := cv.tf(vec{x3, y3}) - cv.path.BezierCurveTo(tf1[0], tf1[1], tf2[0], tf2[1], tf3[0], tf3[1]) -} - // ClosePath closes the path to the beginning of the path or the last point // from a MoveTo call func (cv *Canvas) ClosePath() {