fixed method order
This commit is contained in:
parent
ffd40c721e
commit
3378745af4
1 changed files with 9 additions and 9 deletions
18
paths.go
18
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])
|
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,
|
// 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,
|
// radiusX is the major axis radius, radiusY is the minor axis radius,
|
||||||
// rotation is the rotation of the ellipse in radians, startAngle and endAngle
|
// 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)
|
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
|
// ClosePath closes the path to the beginning of the path or the last point
|
||||||
// from a MoveTo call
|
// from a MoveTo call
|
||||||
func (cv *Canvas) ClosePath() {
|
func (cv *Canvas) ClosePath() {
|
||||||
|
|
Loading…
Reference in a new issue