Class fabric.Path
Extends
fabric.Object.
Path
Defined in: path.class.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
fabric.Path.ATTRIBUTE_NAMES
List of attribute names to account for when parsing SVG element (used by `fabric.Path.fromElement`)
|
- Fields borrowed from class fabric.Object:
- FX_DURATION, FX_TRANSITION, includeDefaultValues, MIN_SCALE_LIMIT, NUM_FRACTION_DIGITS, rotate, selectable, stateProperties
| Method Attributes | Method Name and Description |
|---|---|
|
Returns number representation of an instance complexity
|
|
| <static> |
fabric.Path.fromElement(element, options)
Creates an instance of fabric.Path from an SVG
|
| <static> |
fabric.Path.fromObject(object)
Creates an instance of fabric.Path from an object
|
|
initialize(path, options)
Constructor
|
|
|
render(ctx, noTransform)
Renders path on a specified context
|
|
|
Returns dataless object representation of an instance
|
|
|
toObject()
Returns object representation of an instance
|
|
|
toString()
Returns string representation of an instance
|
- Methods borrowed from class fabric.Object:
- callSuper, clone, cloneAsImage, drawBorders, drawCorners, fxRemove, fxStraighten, get, getAngle, getCenter, getHeight, getWidth, hasStateChanged, intersectsWithObject, intersectsWithRect, isActive, isContainedWithinRect, isType, saveState, scale, scaleToHeight, scaleToWidth, set, setActive, setAngle, setCoords, setGradientFill, setOpacity, setOptions, setSourcePath, setupState, straighten, toDataURL, toggle, toGrayscale, toJSON, transform
Field Detail
<static>
fabric.Path.ATTRIBUTE_NAMES
List of attribute names to account for when parsing SVG element (used by `fabric.Path.fromElement`)
- See:
- http://www.w3.org/TR/SVG/paths.html#PathElement
{String}
type
Method Detail
{Number}
complexity()
Returns number representation of an instance complexity
- Returns:
- {Number} complexity
<static>
{fabric.Path}
fabric.Path.fromElement(element, options)
Creates an instance of fabric.Path from an SVG element
- Parameters:
- {SVGElement} element
- to parse
- {Object} options
- object
- Returns:
- {fabric.Path} Instance of fabric.Path
<static>
{fabric.Path}
fabric.Path.fromObject(object)
Creates an instance of fabric.Path from an object
- Parameters:
- object
- Returns:
- {fabric.Path} Instance of fabric.Path
initialize(path, options)
Constructor
- Parameters:
- {Array|String} path
- Path data (sequence of coordinates and corresponding "command" tokens)
- {Object} options Optional
- Options object
render(ctx, noTransform)
Renders path on a specified context
- Parameters:
- {CanvasRenderingContext2D} ctx
- context to render path on
- {Boolean} noTransform
- When true, context is not transformed
{Object}
toDatalessObject()
Returns dataless object representation of an instance
- Returns:
- {Object}
{Object}
toObject()
Returns object representation of an instance
- Returns:
- {Object}
{String}
toString()
Returns string representation of an instance
- Returns:
- {String} string representation of an instance