【发布时间】:2018-02-23 13:10:53
【问题描述】:
我正在尝试在编辑器加载之前使用强制裁剪。我尝试使用文档中给出的示例,但它会引发错误,提示 Could not find control with identifier crop。
此外,它不适用于 DesktopUI。只有在我使用 ReactUI 时才会调用它。
【问题讨论】:
标签: photoeditorsdk
我正在尝试在编辑器加载之前使用强制裁剪。我尝试使用文档中给出的示例,但它会引发错误,提示 Could not find control with identifier crop。
此外,它不适用于 DesktopUI。只有在我使用 ReactUI 时才会调用它。
【问题讨论】:
标签: photoeditorsdk
标识符为transform:
forceControls: [
{
control: "transform",
options: {
ratios: [
{
identifier: 'imgly_transform_common_9-16', // custom crop
defaultName: '9:16',
ratio: 9 / 16,
dimensions: new this.PhotoEditorSDK.Math.Vector2(720, 1280),
selected: true
},
]
}
}
]
【讨论】:
editor: {
controlsOptions: {
transform: {
ratios: [
{
name: 'your_custom_dimension_name',
ratio: 3 / 1,
defaultName: "3:1",
dimensions: new PhotoEditorSDK.Math.Vector2(600, 200)
}
],
replaceRatios: false
}
}
}
将此代码添加到编辑器对象中,然后它将正常工作。
【讨论】: