## module:Transform(stringopt)

API for manipulating the transform argument used in SVG

#### new module:Transform(stringopt)
`modules/editorElements/Transform.js`, `line 49`

  Initialize the Transform object

  ##### Parameters:

  Name | Type | Attributes | Description
  --- | --- | --- | ---
  `string` | string | <optional> | string in the format of the `transform` argument in SVG, for example `translate(360 150) rotate(90 30 20)`

### Classes

#### Property
`editorElements.module:Transform~Property`

### Members

#### items :Array
`modules/editorElements/Transform.js`, `line 59`

  array of Property instances

### Methods

#### get() → {string}
`modules/editorElements/Transform.js`, `line 217`

  get the transform values in a string

  ##### Returns:

  string -

  string that can be used as a value for the transform property of a SVG element

#### getArguments(index) → {array}
`modules/editorElements/Transform.js`, `line 234`

  get arguments of a property specified by index

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `index` | number | index of the property

  ##### Returns:

  array -

  array of arguments of the specified property

#### getIndex(name) → {number}
`modules/editorElements/Transform.js`, `line 113`

  find a transform property by name and get its index in the items array

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | string | name of the property

  ##### Returns:

  number -

  index of the property in the array of properties or `-1` if not found

#### getRotate() → {Object}
`modules/editorElements/Transform.js`, `line 140`

  get the rotate property

  ##### Returns:

  Object -

  object containing parameters of the rotate attribute

#### getTranslate() → {Object}
`modules/editorElements/Transform.js`, `line 127`

  get the translate property

  ##### Returns:

  Object -

  object containing parameters of the translate attribute

#### pixelConversion(convertor)
`modules/editorElements/Transform.js`, `line 91`

  Convert distances using a specified convertor. Used by toGridPixels and toSVGPixels

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `convertor` | function | function that converts int to int

#### rotateLeft(centerX, centerY)
`modules/editorElements/Transform.js`, `line 209`

  rotate by 90 degrees to the left

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `centerX` | number | horizontal position of the center of the rotation
  `centerY` | number | vertical position of the center of the rotation

#### rotateRight(centerX, centerY)
`modules/editorElements/Transform.js`, `line 200`

  rotate by 90 degrees to the right

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `centerX` | number | horizontal position of the center of the rotation
  `centerY` | number | vertical position of the center of the rotation

#### rotateRightAngle(centerX, centerY, right)
`modules/editorElements/Transform.js`, `line 175`

  rotate by 90 degrees to the right or left, depending on the parameter `right`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `centerX` | number | horizontal position of the center of the rotation
  `centerY` | number | vertical position of the center of the rotation
  `right` | boolean | rotate to the right if `true`, to the left if `false`

#### setParameter(name, args)
`modules/editorElements/Transform.js`, `line 243`

  set argumets of a property specified by name

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | string | name of the property
  `args` | array | array of arguments of the specified property

#### setRotate(deg, centerX, centerY)
`modules/editorElements/Transform.js`, `line 165`

  set rotate to the specified values

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `deg` | number | angle of the rotation in degrees
  `centerX` | number | horizontal position of the center of the rotation
  `centerY` | number | vertical position of the center of the rotation

#### setTranslate(x, y)
`modules/editorElements/Transform.js`, `line 155`

  set translate to the specified values

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `x` | number | horizontal translation
  `y` | number | vertical translation

#### toGridPixels(appInstance)
`modules/editorElements/Transform.js`, `line 75`

  convert distances from SVG pixels to grid pixels

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `appInstance` | App | instance of App

#### toSVGPixels(appInstance)
`modules/editorElements/Transform.js`, `line 83`

  convert distances from grid pixels to SVG pixels

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `appInstance` | App | instance of App