goog.graphics.ext.Path
Provided By | |
---|---|
Extends |
Creates a path object
new Path()
Parameters | None. |
---|
Instance Methods
this.appendPath( path ) → goog.graphics.Path
goog.graphics.Path
Appends another path to the end of this path.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.arc( cx, cy, rx, ry, fromAngle, extent, connect ) → goog.graphics.Path
goog.graphics.Path
Adds a path command to draw an arc centered at the point (cx, cy)
with radius rx
along the x-axis and ry
along the y-axis from
startAngle
through extent
degrees. Positive rotation is in
the direction from positive x-axis to positive y-axis.
warning Deprecated | Use |
---|
Defined by | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||||||||||||||
Returns |
|
this.arcTo( rx, ry, fromAngle, extent ) → goog.graphics.Path
goog.graphics.Path
Adds a path command to draw an arc starting at the path's current point,
with radius rx
along the x-axis and ry
along the y-axis from
startAngle
through extent
degrees. Positive rotation is in
the direction from positive x-axis to positive y-axis.
This method makes the path non-simple.
Defined by | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||
Returns |
|
this.arcToAsCurves( rx, ry, fromAngle, extent ) → goog.graphics.Path
goog.graphics.Path
Same as arcTo
, but approximates the arc using bezier curves.
.* As a result, this method does not affect the simplified status of this path.
The algorithm is adapted from java.awt.geom.ArcIterator
.
Defined by | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||
Returns |
|
this.clear() → goog.graphics.Path
goog.graphics.Path
Clears the path.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.clone() → goog.graphics.ext.Path
goog.graphics.ext.Path
Clones the path.
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.close() → goog.graphics.Path
goog.graphics.Path
Adds a path command to close the path by connecting the last point to the first point.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.createTransformedPath( tx ) → goog.graphics.Path
goog.graphics.Path
Creates a transformed copy of this path. The path is simplified #createSimplifiedPath prior to transformation.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.curveTo( ...var_args ) → goog.graphics.Path
goog.graphics.Path
Adds points to the path by drawing cubic Bezier curves. Each curve is specified using 3 points (6 coordinates) - two control points and the end point of the curve.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.forEachSegment( callback ) → void
void
Iterates over the path calling the supplied callback once for each path segment. The arguments to the callback function are the segment type and an array of its arguments.
The LINETO
and CURVETO
arrays can contain multiple
segments of the same type. The number of segments is the length of the
array divided by the segment length (2 for lines, 6 for curves).
As a convenience the ARCTO
segment also includes the end point as the
last two arguments: rx, ry, fromAngle, extent, x, y
.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.getBoundingBox() → (goog.math.Rect|null)
(goog.math.Rect|null)
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isEmpty() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isSimple() → boolean
boolean
Returns true if this path contains no arcs. Simplified paths can be
created using createSimplifiedPath
.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.lineTo( ...var_args ) → goog.graphics.Path
goog.graphics.Path
Adds points to the path by drawing a straight line to each point.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.modifyBounds( deltaX, deltaY, xFactor, yFactor ) → goog.graphics.ext.Path
goog.graphics.ext.Path
Modify the bounding box of the path. This may cause the path to be simplified (i.e. arcs converted to curves) as a side-effect.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.moveTo( x, y ) → goog.graphics.Path
goog.graphics.Path
Adds a point to the path by moving to the specified point. Repeated moveTo commands are collapsed into a single moveTo.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.transform( tx ) → goog.graphics.ext.Path
goog.graphics.ext.Path
Transforms the path. Only simple paths are transformable. Attempting to transform a non-simple path will throw an error.
Overrides | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.useBoundingBox( bounds ) → void
void
Set the precomputed bounds.
Parameters |
|
---|