Class fabric.Polygon
Extends
fabric.Object.
Polygon
Defined in: polygon.class.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> |
fabric.Polygon.ATTRIBUTE_NAMES
List of attribute names to account for when parsing SVG element (used by `fabric.Polygon.fromElement`)
|
- Fields borrowed from class fabric.Object:
- FX_DURATION, FX_TRANSITION, includeDefaultValues, MIN_SCALE_LIMIT, NUM_FRACTION_DIGITS, options, rotate, stateProperties
Method Attributes | Method Name and Description |
---|---|
Returns complexity of an instance
|
|
<static> |
fabric.Polygon.fromElement(element, options)
Returns fabric.Polygon instance from an SVG element
|
<static> |
fabric.Polygon.fromObject(object)
Returns fabric.Polygon instance from an object representation
|
initialize(points, options)
Constructor
|
|
toObject()
Returns object 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, render, saveState, scale, scaleToHeight, scaleToWidth, set, setActive, setAngle, setCoords, setOpacity, setOptions, setSourcePath, straighten, toDatalessObject, toDataURL, toggle, toGrayscale, toJSON, toString, transform
Field Detail
<static>
fabric.Polygon.ATTRIBUTE_NAMES
List of attribute names to account for when parsing SVG element (used by `fabric.Polygon.fromElement`)
{String}
type
Method Detail
{Number}
complexity()
Returns complexity of an instance
- Returns:
- {Number} complexity of this instance
<static>
{fabric.Polygon}
fabric.Polygon.fromElement(element, options)
Returns fabric.Polygon instance from an SVG element
- Parameters:
- {SVGElement} element
- Element to parse
- {Object} options
- Options object
- Returns:
- {fabric.Polygon}
<static>
{fabric.Polygon}
fabric.Polygon.fromObject(object)
Returns fabric.Polygon instance from an object representation
- Parameters:
- {Object} object
- Object to create an instance from
- Returns:
- {fabric.Polygon}
{fabric.Polygon}
initialize(points, options)
Constructor
- Parameters:
- {Array} points
- Array of points
- {Object} options
- Options object
- Returns:
- {fabric.Polygon} thisArg
{Object}
toObject()
Returns object representation of an instance
- Returns:
- {Object} object representation of an instance