Hi,
I am using the following to add a custom shape to the image.
What I am struggling with is how do i keep the original shape aspect ration.
If I place the shape manually I hold the Shift key to keep proportions.
In UXP I need to specify the size.
So how can I maintain the original aspect ration, or how can I know the original shape dimensions.
async function myAddLogo(logoName, color, coord) {
// const { app, core, action } = require("photoshop");
await require("photoshop").core.executeAsModal(async (executionControl, descriptor) => {
const result = await batchPlay(
[
{
_obj: "make",
_target: [
{
_ref: "contentLayer"
}
],
using: {
_obj: "contentLayer",
type: {
_obj: "solidColorLayer",
color: {
_obj: "RGBColor",
red: color.red,
grain: color.grain,
blue: color.blue
}
},
shape: {
_obj: "customShape",
name: logoName,
keyOriginType: 9,
top: {
_unit: "pixelsUnit",
_value: coord.top
},
left: {
_unit: "pixelsUnit",
_value: coord.left
},
bottom: {
_unit: "pixelsUnit",
_value: coord.bottom
},
right: {
_unit: "pixelsUnit",
_value: coord.right
}
}
},
_options: {
dialogOptions: "dontDisplay"
}
}
],
{});
});
}