Class: TransformControls

PhotoEditorSDK.UI~DesktopUI.Controls. TransformControls

The Controls for the Transform tool.

new PhotoEditorSDK.UI.DesktopUI.Controls.TransformControls()

ui/desktop-ui/controls/transform/index.js, line 31

Extends

Members

activeIconPathString

The active icon path of this control

canvasControlsComponentReact.Component

The canvas component for these controls

controlsComponentReact.Component

The controls component for these controls

defaultOptionsObject

The default options for this control

Properties:
Name Type Argument Default Description
ratios Array.<Object> <optional>
[]
replaceRatios Boolean <optional>
false
availableRatios Array.<String> <optional>
null
enableRotation Boolean <optional>
true
enableStraighten Boolean <optional>
true
enableFlip Boolean <optional>
true
enableAcceptButton Boolean <optional>
false

iconPathString

The icon path of this control

identifierString

A unique identifier for these controlsComponent

requiredOperationsArray

The operations required for this control to work properly

switchToDefaultControlsOnRemovalBoolean

If true, the editor will switch to the default controls when any of the updatableOperations is removed.

updatableOperationsArray.<String>

Operations which will trigger UI updates on this controls.

Methods

staticPhotoEditorSDK.UI.DesktopUI.Controls.TransformControls.getPreloadAssets(editor){Array.<String>}

ui/desktop-ui/controls/transform/index.js, line 482

Returns the assets that should be preloaded for this control

Name Type Description
editor PhotoEditorSDK.UI.DesktopUI.Editor
Returns:
Type Description
Array.<String>

staticPhotoEditorSDK.UI.DesktopUI.Controls.TransformControls.isEnabled(){Boolean}

ui/desktop-ui/controls/transform/index.js, line 518

Checks if this control is enabled

Returns:
Type Description
Boolean

staticPhotoEditorSDK.UI.DesktopUI.Controls.TransformControls.mapOperationsToSharedState(operations, initial){Object}

ui/desktop-ui/controls/transform/index.js, line 115

Maps the operations state to a shared state object. Called whenever one of the updatableOperations is modified, created or removed.

Name Type Default Description
operations Object
initial Boolean false optional
Returns:
Type Description
Object
  • An object that will be passet to sharedState.set

applyNewTransformOptions()

ui/desktop-ui/controls/transform/index.js, line 314

Applies the current transformation options to the transform operation

fixTransform(start, end, horizontalSide, verticalSide)

ui/desktop-ui/controls/transform/index.js, line 401

Fixes the given start and end coordinates to represent a valid transform. The horizontalSide and verticalSide flags indicate which corner has been dragged.

Name Type Description
start PhotoEditorSDK.Math.Vector2
end PhotoEditorSDK.Math.Vector2
horizontalSide String
verticalSide String