goog.graphics.ext.Path
Classgoog.graphics.ext.Path
> goog.graphics.Path
goog.graphics.ext.Path()
Creates a path object
.appendPath(path)
Inherited from goog.graphics.Path
.
Appends another path to the end of this path.
path
{!goog.graphics.Path
}
goog.graphics.Path
}
.arc(cx, cy, rx, ry, fromAngle, extent, connect)
[deprecated]Deprecated. Use {@code arcTo} or {@code arcToAsCurves} instead.
Inherited from goog.graphics.Path
.
Adds a path command to draw an arc centered at the point {@code (cx, cy)} with radius {@code rx} along the x-axis and {@code ry} along the y-axis from {@code startAngle} through {@code extent} degrees. Positive rotation is in the direction from positive x-axis to positive y-axis.
cx
{number
}
cy
{number
}
rx
{number
}
ry
{number
}
fromAngle
{number
}
extent
{number
}
connect
{boolean
}
goog.graphics.Path
}
.arcTo(rx, ry, fromAngle, extent)
Inherited from goog.graphics.Path
.
Adds a path command to draw an arc starting at the path's current point, with radius {@code rx} along the x-axis and {@code ry} along the y-axis from {@code startAngle} through {@code extent} degrees. Positive rotation is in the direction from positive x-axis to positive y-axis. This method makes the path non-simple.
rx
{number
}
ry
{number
}
fromAngle
{number
}
extent
{number
}
goog.graphics.Path
}
.arcToAsCurves(rx, ry, fromAngle, extent)
Inherited from goog.graphics.Path
.
Same as {@code 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 {@code java.awt.geom.ArcIterator}.
rx
{number
}
ry
{number
}
fromAngle
{number
}
extent
{number
}
goog.graphics.Path
}
.clear()
Inherited from goog.graphics.Path
.
Clears the path.
goog.graphics.Path
}
.clone()
Clones the path.
goog.graphics.ext.Path
}
.close()
Inherited from goog.graphics.Path
.
Adds a path command to close the path by connecting the last point to the first point.
goog.graphics.Path
}
.createTransformedPath(tx)
Inherited from goog.graphics.Path
.
Creates a transformed copy of this path. The path is simplified {@see #createSimplifiedPath} prior to transformation.
tx
{!goog.graphics.AffineTransform
}
goog.graphics.Path
}
.curveTo(var_args)
Inherited from 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.
var_args
{...number
}
goog.graphics.Path
}
.forEachSegment(callback)
Inherited from goog.graphics.Path
.
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 {@code LINETO} and {@code 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 {@code ARCTO} segment also includes the end point as the last two arguments: {@code rx, ry, fromAngle, extent, x, y}.
callback
{function
(number
, Array
)}
.getBoundingBox()
goog.math.Rect
?}
.getCurrentPoint()
Inherited from goog.graphics.Path
.
Returns the coordinates most recently added to the end of the path.
Array
.<number
>?}
.isEmpty()
Inherited from goog.graphics.Path
.
boolean
}
.isSimple()
Inherited from goog.graphics.Path
.
Returns true if this path contains no arcs. Simplified paths can be created using {@code createSimplifiedPath}.
boolean
}
.lineTo(var_args)
Inherited from goog.graphics.Path
.
Adds points to the path by drawing a straight line to each point.
var_args
{...number
}
goog.graphics.Path
}
.modifyBounds(deltaX, deltaY, xFactor, yFactor)
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.
deltaX
{number
}
deltaY
{number
}
xFactor
{number
}
yFactor
{number
}
goog.graphics.ext.Path
}
.moveTo(x, y)
Inherited from goog.graphics.Path
.
Adds a point to the path by moving to the specified point. Repeated moveTo commands are collapsed into a single moveTo.
x
{number
}
y
{number
}
goog.graphics.Path
}
.transform(tx)
Transforms the path. Only simple paths are transformable. Attempting to transform a non-simple path will throw an error.
tx
{!goog.graphics.AffineTransform
}
goog.graphics.ext.Path
}
.useBoundingBox(bounds)
Set the precomputed bounds.
bounds
{goog.math.Rect
?}