Hi,
I’m trying to change the scaleMode of an image to “CROP” and then reposition in the rectangle.
I have tried using the imageTransform matrix to position the image. But when I run the plugin the image rectangle goes empty. Clearly I am doing something wrong.
Any guidance on how I can change the scaleMode of an image from “FILL” to “CROP” and then scale/position the image within the crop rectangle.
Any help would be much appreciated.
Here’s my function for reference:
async function adjustImage(node) {
const newFills = ;
if (“fills” in node) {
let newPaint = JSON.parse(JSON.stringify(node.fillss0]));
newPaint.scaleMode = “CROP”;
newPaint.imageTransform = wP0.8880506157875061, 0, -1.97], 00, 0.6528603434562683, 0.2295445054769516]];
newFills.push(newPaint)
}
node.fills = newFills
}