Copy link to clipboard
Copied
I hope the JavaScript implementation
thank!
1 Correct answer
If you wish to create or modify a rectangle with rounded corners, you will have to add/remove the extra path points and set their Bezier handles yourself.
https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints.html
That is how the corner rounding options in Properties panel really does it, which you can check:
alert(app.activeDocument.pathItems[0].pathPoints.length)
Explore related tutorials & articles
Copy link to clipboard
Copied
Help Me please
Copy link to clipboard
Copied
I hope the JavaScript implementation
thank!
Copy link to clipboard
Copied
If you wish to create or modify a rectangle with rounded corners, you will have to add/remove the extra path points and set their Bezier handles yourself.
https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints.html
That is how the corner rounding options in Properties panel really does it, which you can check:
alert(app.activeDocument.pathItems[0].pathPoints.length)
Copy link to clipboard
Copied
Help Me please
Copy link to clipboard
Copied
Essayez cela...
// JavaScript Document for Illustrator
var docRef = app.activeDocument,
objetSelect = selection[0],
rects = objetSelect.geometricBounds,
propRects = prop(rects),
larg = propRects[0],
haut = propRects[1],
objetRect = docRef.pathItems.rectangle(rects[1],rects[0],larg,haut);
objetSelect.remove();
// -------
function prop(Bounds) {return [Bounds[2]-Bounds[0],Bounds[1]-Bounds[3]];}
// -------