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}.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(type: EnumValue, ex?: number, ey?: number, x1?: number, y1?: number, x2?: number, y2?: number, clockwise?: boolean): PathSegment

Constructs a segment that goes nowhere unless you specify some Points.

Parameters

  • type: EnumValue
  • ex?: number optional

    optional: the X coordinate of the end point.

  • ey?: number optional

    optional: the Y coordinate of the end point.

  • x1?: number optional

    optional: the X coordinate of the first bezier control point.

  • y1?: number optional

    optional: the Y coordinate of the first bezier control point.

  • x2?: number optional

    optional: the X coordinate of the second cubic bezier control point.

  • y2?: number optional

    optional: the Y coordinate of the second cubic bezier control point, or the large-arc-flag of an SvgArc.

  • clockwise?: boolean optional

    optional: whether an SvgArc goes clockwise or counterclockwise.

Returns

PathSegment

Properties

public static Arc: EnumValue

For drawing an arc segment, a value for PathSegment#type.

public static Bezier: EnumValue

For drawing a cubic bezier segment, a value for PathSegment#type.

public static Line: EnumValue

For drawing a straight line segment, a value for PathSegment#type.

public static Move: EnumValue

For beginning a new subpath, a value for PathSegment#type.

public static QuadraticBezier: EnumValue

For drawing a quadratic bezier segment, a value for PathSegment#type.

public static SvgArc: EnumValue

For drawing an SVG arc segment, a value for PathSegment#type.

public centerX: number

Gets or sets the center X value of the Arc for a PathSegment of type #Arc.

public centerY: number

Gets or sets the center Y value of the Arc for a PathSegment of type #Arc.

public endX: number

Gets or sets the X coordinate of the end point for all kinds of PathSegment.

public endY: number

Gets or sets the Y coordinate of the end point for all kinds of PathSegment.

public isClockwiseArc: boolean

Gets or sets the sweep-flag for a PathSegment of type #SvgArc.

public isClosed: boolean

Gets or sets whether the path is closed after this PathSegment.

public isLargeArc: boolean

Gets or sets the large-arc-flag for a PathSegment of type #SvgArc.

public point1X: number

Gets or sets the X value of the first control point for a PathSegment of type #Bezier or #QuadraticBezier.

public point1Y: number

Gets or sets the Y value of the first control point for a PathSegment of type #Bezier or #QuadraticBezier.

public point2X: number

Gets or sets the X value of the second control point for a PathSegment of type cubic #Bezier.

public point2Y: number

Gets or sets the Y value of the second control point for a PathSegment of type cubic #Bezier.

public radiusX: number

Gets or sets the X value of the radius for a PathSegment of type #Arc.

public radiusY: number

Gets or sets the Y value of the radius for a PathSegment of type #Arc.

public startAngle: number

Gets or sets the starting angle for a PathSegment of type #Arc.

public sweepAngle: number

Gets or sets the length of angle in degrees, or amount of arc to "sweep" for a PathSegment of type #Arc.

public type: EnumValue

Gets or sets the type of the PathSegment.

public xAxisRotation: number

Gets or sets the X-axis rotation for a PathSegment of type #SvgArc.

Methods

public close(): PathSegment

Closes the path after this PathSegment.

Returns

PathSegment

public copy(): PathSegment

Makes a copy of this PathSegment.

Returns

PathSegment