Class PathSegment
A PathSegment represents a straight line or curved segment of a path between two or more points that are part of a PathFigure.
A PathSegment must not be modified once its containing PathFigure's Geometry has been assigned to a Shape.
Constructor Summary Details
Name | Description |
---|---|
PathSegment(type, ex, ey, x1, y1, x2, y2, clockwise)
|
Constructs a segment that goes nowhere unless you specify some Points.More... The segment type must be one of the following values: PathSegment.Line, PathSegment.Bezier, PathSegment.QuadraticBezier, PathSegment.Arc, PathSegment.SvgArc. You will want to add a new instance of a PathSegment to the PathFigure.segments list of a PathFigure.
|
Properties Summary Details
Name, Value Type | Description |
---|---|
centerX
{number}
|
Gets or sets the center X value of the Arc for a PathSegment of type Arc. |
centerY
{number}
|
Gets or sets the center Y value of the Arc for a PathSegment of type Arc. |
endX
{number}
|
|
endY
{number}
|
|
isClockwiseArc
{boolean}
|
Gets or sets the clockwise-flag for a PathSegment of type SvgArc.More... SVG Arcs specify a radius and an endpoint, and are always a portion of an ellipse. The parameters allow for two potential ellipses and four potential arcs. A clockwise-flag set to true will use one of the two possible positive-angle arcs, and false will use one of the two negative-angle arcs. Which arc is chosen (small or large) depends on the value of isLargeArc. For more information see the visual examples in the SVG Arc specification (w3.org) |
isClosed
{boolean}
|
Gets or sets whether the path is closed after this PathSegment.More... Default value is false. |
isLargeArc
{boolean}
|
Gets or sets the large-arc-flag for a PathSegment of type SvgArc.More... SVG Arcs specify a radius and an endpoint, and are always a portion of an ellipse. The parameters allow for two potential ellipses and four potential arcs. A large-arc-flag set to true will choose the larger of the two arc sweeps. Which way the arc sweeps (positive angle or negative angle) depends on the value of isClockwiseArc For more information see the visual examples in the SVG Arc specification (w3.org) |
point1X
{number}
|
Gets or sets the X value of the first control point for a PathSegment of type Bezier or QuadraticBezier. |
point1Y
{number}
|
Gets or sets the Y value of the first control point for a PathSegment of type Bezier or QuadraticBezier. |
point2X
{number}
|
Gets or sets the X value of the second control point for a PathSegment of type cubic Bezier. |
point2Y
{number}
|
Gets or sets the Y value of the second control point for a PathSegment of type cubic Bezier. |
radiusX
{number}
|
|
radiusY
{number}
|
|
startAngle
{number}
|
|
sweepAngle
{number}
|
|
type
{EnumValue}
|
Gets or sets the type of the PathSegment.More... The value must be one of the following: PathSegment.Line, PathSegment.Bezier, PathSegment.QuadraticBezier, PathSegment.Arc, PathSegment.Move, PathSegment.Arc, and PathSegment.SvgArc. |
xAxisRotation
{number}
|
Method Summary Details
Name, Return Type | Description |
---|---|
close()
|
Closes the path after this PathSegment
|
copy()
|
Create a copy of this PathSegment, of the same type and with the same point values.
|
Constants Summary Details
Name | Description |
---|---|
Arc
{EnumValue}
|
For drawing an arc segment, a value for PathSegment.type. |
Bezier
{EnumValue}
|
For drawing a cubic bezier segment, a value for PathSegment.type. |
Line
{EnumValue}
|
For drawing a straight line segment, a value for PathSegment.type. |
Move
{EnumValue}
|
For beginning a new subpath, a value for PathSegment.type. |
QuadraticBezier
{EnumValue}
|
For drawing a quadratic bezier segment, a value for PathSegment.type. |
SvgArc
1.1
{EnumValue}
|
For drawing an SVG arc segment, a value for PathSegment.type; see: SVG Arc specification (w3.org) |