draw2d/path.go

40 lines
1.6 KiB
Go
Raw Normal View History

2011-04-27 08:06:14 +00:00
// Copyright 2010 The draw2d Authors. All rights reserved.
// created: 21/11/2010 by Laurent Le Goff
2012-04-17 09:03:56 +00:00
2011-04-27 08:06:14 +00:00
package draw2d
2015-07-08 08:53:35 +00:00
// Path describes the interface for path drawing.
2011-04-27 08:06:14 +00:00
type Path interface {
2015-07-08 08:53:35 +00:00
// LastPoint returns the current point of the path
2011-04-27 08:06:14 +00:00
LastPoint() (x, y float64)
2015-07-08 08:53:35 +00:00
// MoveTo creates a new subpath that start at the specified point
2011-04-27 08:06:14 +00:00
MoveTo(x, y float64)
2015-07-08 08:53:35 +00:00
// RMoveTo creates a new subpath that start at the specified point
2012-04-17 09:03:56 +00:00
// relative to the current point
2011-04-27 08:06:14 +00:00
RMoveTo(dx, dy float64)
2015-07-08 08:53:35 +00:00
// LineTo adds a line to the current subpath
2011-04-27 08:06:14 +00:00
LineTo(x, y float64)
2015-07-08 08:53:35 +00:00
// RLineTo adds a line to the current subpath
2012-04-17 09:03:56 +00:00
// relative to the current point
2011-04-27 08:06:14 +00:00
RLineTo(dx, dy float64)
2015-07-08 08:53:35 +00:00
// QuadCurveTo adds a quadratic Bézier curve to the current subpath
2011-04-27 08:06:14 +00:00
QuadCurveTo(cx, cy, x, y float64)
2015-07-08 08:53:35 +00:00
// QuadCurveTo adds a quadratic Bézier curve to the current subpath
// relative to the current point
2011-04-27 08:06:14 +00:00
RQuadCurveTo(dcx, dcy, dx, dy float64)
2015-07-08 08:53:35 +00:00
// CubicCurveTo adds a cubic Bézier curve to the current subpath
2011-04-27 08:06:14 +00:00
CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64)
2015-07-08 08:53:35 +00:00
// RCubicCurveTo adds a cubic Bézier curve to the current subpath
// relative to the current point
2011-04-27 08:06:14 +00:00
RCubicCurveTo(dcx1, dcy1, dcx2, dcy2, dx, dy float64)
2015-07-08 08:53:35 +00:00
// ArcTo adds an arc to the current subpath
2011-04-27 08:06:14 +00:00
ArcTo(cx, cy, rx, ry, startAngle, angle float64)
2015-07-08 08:53:35 +00:00
// RArcTo adds an arc to the current subpath
// relative to the current point
2011-04-27 08:06:14 +00:00
RArcTo(dcx, dcy, rx, ry, startAngle, angle float64)
2015-07-08 08:53:35 +00:00
// 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.
2011-04-27 08:06:14 +00:00
Close()
}