From 33f067e4dd4ee0e828267af9b592b94214b6d584 Mon Sep 17 00:00:00 2001 From: Stani Date: Wed, 8 Jul 2015 10:53:35 +0200 Subject: [PATCH] add docstrings to path.go --- path.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/path.go b/path.go index 7167a7c..3a14ab2 100644 --- a/path.go +++ b/path.go @@ -3,25 +3,37 @@ package draw2d +// Path describes the interface for path drawing. type Path interface { - // Return the current point of the path + // LastPoint returns the current point of the path LastPoint() (x, y float64) - // Create a new subpath that start at the specified point + // MoveTo creates a new subpath that start at the specified point MoveTo(x, y float64) - // Create a new subpath that start at the specified point + // RMoveTo creates a new subpath that start at the specified point // relative to the current point RMoveTo(dx, dy float64) - // Add a line to the current subpath + // LineTo adds a line to the current subpath LineTo(x, y float64) - // Add a line to the current subpath + // RLineTo adds a line to the current subpath // relative to the current point RLineTo(dx, dy float64) - + // QuadCurveTo adds a quadratic Bézier curve to the current subpath QuadCurveTo(cx, cy, x, y float64) + // QuadCurveTo adds a quadratic Bézier curve to the current subpath + // relative to the current point RQuadCurveTo(dcx, dcy, dx, dy float64) + // CubicCurveTo adds a cubic Bézier curve to the current subpath CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64) + // RCubicCurveTo adds a cubic Bézier curve to the current subpath + // relative to the current point RCubicCurveTo(dcx1, dcy1, dcx2, dcy2, dx, dy float64) + // ArcTo adds an arc to the current subpath ArcTo(cx, cy, rx, ry, startAngle, angle float64) + // RArcTo adds an arc to the current subpath + // relative to the current point RArcTo(dcx, dcy, rx, ry, startAngle, angle float64) + // Close creates a line from the current point to the last MoveTo + // point (if not the same) and mark the path as closed so the + // first and last lines join nicely. Close() }