APIs

Show:

Point class

Constructor

fabric.Point

(
  • x
  • y
)
fabric.Point

Parameters:

Returns:

fabric.Point:

thisArg

Item Index

Methods

Properties

Methods

external:String#trim

()

Trims a string (removing whitespace from the beginning and the end)

(
  • element
  • eventName
  • handler
)

Adds an event listener to an element

Parameters:

(
  • element
  • eventName
  • handler
)

Removes an event listener from an element

Parameters:

(
  • element
)
Object

Returns offset for a given element

Parameters:

Returns:

Object:

Object with "left" and "top" properties

(
  • attributeValue
)
Array static

Parses "transform" attribute, returning an array of values

Parameters:

  • attributeValue String

    String containing attribute value

Returns:

Array:

Array of 6 elements representing transformation matrix

(
  • doc
  • callback
  • [reviver]
)
static

Parses an SVG document, converts it to an array of corresponding fabric.* instances and passes them to a callback

Parameters:

  • doc SVGDocument

    SVG document to parse

  • callback Function

    Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document).

  • [reviver] Function optional

    Method for further parsing of SVG elements, called after each fabric object created.

(
  • doc
)
Object static

Parses an SVG document, returning all of the gradient declarations found in it

Parameters:

  • doc SVGDocument

    SVG document to parse

Returns:

Object:

Gradient definitions; key corresponds to element id, value -- to gradient definition element

(
  • doc
)
Object static

Returns CSS rules for a given SVG document

Parameters:

  • doc SVGDocument

    SVG document to parse

Returns:

Object:

CSS rules of this document

Properties