public class Path extends Object
Constructor and Description |
---|
Path()
Creates an empty path.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the current contour.
|
void |
cubicTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Adds a cubic bezier from the last point, approaching control points (x1,y1) and (x2,y2), and ending at (x3,y3).
|
void |
cubicToRelative(float dx1,
float dy1,
float dx2,
float dy2,
float dx3,
float dy3)
Same as
cubicTo(float, float, float, float, float, float) , but the coordinates are considered relative
to the current point on this contour. |
float |
getBottomBound()
Gets the bottom bound of this path.
|
float |
getLeftBound()
Gets the left bound of this path.
|
float |
getRightBound()
Gets the right bound of this path.
|
float |
getTopBound()
Gets the top bound of this path.
|
void |
lineTo(float x,
float y)
Adds a line from the last point to the specified point (x,y).
|
void |
lineToRelative(float dx,
float dy)
Same as
lineTo(float, float) , but the coordinates are considered relative to the last point on this
contour. |
void |
moveTo(float x,
float y)
Sets the beginning of the next contour to the point (x,y).
|
void |
moveToRelative(float dx,
float dy)
Sets the beginning of the next contour relative to the last point on the previous contour.
|
void |
quadTo(float x1,
float y1,
float x2,
float y2)
Adds a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2).
|
void |
quadToRelative(float dx1,
float dy1,
float dx2,
float dy2)
Same as
quadTo(float, float, float, float) , but the coordinates are considered relative to the last
point on this contour. |
void |
reset()
Resets the path to an empty one.
|
void |
setOrigin(float dx,
float dy)
Sets the offset that will be applied to all the subsequent absolute points of the contour.
|
public void close()
public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3)
moveTo(float, float)
call has been made for this contour, the first point is automatically set to
(0,0).x1
- the x-coordinate of the 1st control point on a cubic curvey1
- the y-coordinate of the 1st control point on a cubic curvex2
- the x-coordinate of the 2nd control point on a cubic curvey2
- the y-coordinate of the 2nd control point on a cubic curvex3
- the x-coordinate of the end point on a cubic curvey3
- the y-coordinate of the end point on a cubic curvepublic void cubicToRelative(float dx1, float dy1, float dx2, float dy2, float dx3, float dy3)
cubicTo(float, float, float, float, float, float)
, but the coordinates are considered relative
to the current point on this contour. If there is no previous point, then a moveTo(0,0) is inserted
automatically.dx1
- the x-coordinate of the 1st control point on a cubic curvedy1
- the y-coordinate of the 1st control point on a cubic curvedx2
- the x-coordinate of the 2nd control point on a cubic curvedy2
- the y-coordinate of the 2nd control point on a cubic curvedx3
- the x-coordinate of the end point on a cubic curvedy3
- the y-coordinate of the end point on a cubic curvepublic float getBottomBound()
If this path does not contain any point, all bounds are equal to 0.
public float getLeftBound()
If this path does not contain any point, all bounds are equal to 0.
public float getRightBound()
If this path does not contain any point, all bounds are equal to 0.
public float getTopBound()
If this path does not contain any point, all bounds are equal to 0.
public void lineTo(float x, float y)
moveTo(float, float)
call has been
made for this contour, the first point is automatically set to (0,0).x
- the x-coordinate of the end of a liney
- the y-coordinate of the end of a linepublic void lineToRelative(float dx, float dy)
lineTo(float, float)
, but the coordinates are considered relative to the last point on this
contour. If there is no previous point, then a moveTo(0,0)
is inserted automatically.dx
- the amount to add to the x-coordinate of the previous point on this contour, to specify a linedy
- the amount to add to the y-coordinate of the previous point on this contour, to specify a linepublic void moveTo(float x, float y)
x
- the x-coordinate of the start of a new contoury
- the y-coordinate of the start of a new contourpublic void moveToRelative(float dx, float dy)
moveTo(float, float)
.dx
- the amount to add to the x-coordinate of the end of the previous contour, to specify the start of a
new contourdy
- the amount to add to the y-coordinate of the end of the previous contour, to specify the start of a
new contourpublic void quadTo(float x1, float y1, float x2, float y2)
moveTo(float, float)
call has been made for this contour, the first point is automatically set to (0,0).x1
- the x-coordinate of the control point on a quadratic curvey1
- the y-coordinate of the control point on a quadratic curvex2
- the x-coordinate of the end point on a quadratic curvey2
- the y-coordinate of the end point on a quadratic curvepublic void quadToRelative(float dx1, float dy1, float dx2, float dy2)
quadTo(float, float, float, float)
, but the coordinates are considered relative to the last
point on this contour. If there is no previous point, then a moveTo(0,0) is inserted automatically.dx1
- the amount to add to the x-coordinate of the last point on this contour, for the control point of a
quadratic curvedy1
- the amount to add to the y-coordinate of the last point on this contour, for the control point of a
quadratic curvedx2
- the amount to add to the x-coordinate of the last point on this contour, for the end point of a
quadratic curvedy2
- the amount to add to the y-coordinate of the last point on this contour, for the end point of a
quadratic curvepublic void reset()
The origin is also reset to (0,0).
public void setOrigin(float dx, float dy)
dx
- the amount in the x direction to offset the subsequent pointsdy
- the amount in the y direction to offset the subsequent points