Participant
July 3, 2025
Question
Illustrator Script Problem – Design gets stretched when resizing
- July 3, 2025
- 1 reply
- 372 views
Hi,
I created this custom JSX script in Illustrator to export selected designs. Everything works fine, except for one issue: the design gets stretched instead of scaling properly and fills the artboard, rather than maintaining the design's original ratio and proportions.
Here’s the part of the code that resizes the design:
group.position = [docWidth/2 - (width/2), docHeight/2 + (height/2)];
group.resize((docWidth - 10) / width * 100, (docHeight - 10) / height * 100);Problem:
This code changes the aspect ratio and stretches the design.
I want the design to keep its original aspect ratio and be scaled proportionally, with about a 5px margin
Can someone help me fix this part so the design doesn’t stretch?
Thanks!
